diff options
| author | Paul Traina <pst@FreeBSD.org> | 1997-06-28 08:18:29 +0000 |
|---|---|---|
| committer | Paul Traina <pst@FreeBSD.org> | 1997-06-28 08:18:29 +0000 |
| commit | 4cbf8903a2fe279adc72935f0864d44c97776d57 (patch) | |
| tree | 64dc7007518fead8c2532e7537cba3ef76a9f678 /sbin | |
| parent | 3d8cd70cec4107d5afd1d42486566f2060673773 (diff) | |
Notes
Diffstat (limited to 'sbin')
| -rw-r--r-- | sbin/init/init.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sbin/init/init.c b/sbin/init/init.c index ed2da13252f9..6e9c9b4d0a41 100644 --- a/sbin/init/init.c +++ b/sbin/init/init.c @@ -33,7 +33,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: init.c,v 1.17 1997/06/13 06:24:42 charnier Exp $ */ #ifndef lint @@ -935,6 +935,7 @@ new_session(sprev, session_index, typ) register struct ttyent *typ; { register session_t *sp; + int fd; if ((typ->ty_status & TTY_ON) == 0 || typ->ty_name == 0 || @@ -949,6 +950,18 @@ new_session(sprev, session_index, typ) sp->se_device = malloc(sizeof(_PATH_DEV) + strlen(typ->ty_name)); (void) sprintf(sp->se_device, "%s%s", _PATH_DEV, typ->ty_name); + /* + * Attempt to open the device, if we get "device not configured" + * then don't add the device to the session list. + */ + if ((fd = open(sp->se_device, O_RDONLY | O_NONBLOCK, 0)) < 0) { + if (errno == ENXIO) { + free_session(sp); + return (0); + } + } else + close(fd); + if (setupargv(sp, typ) == 0) { free_session(sp); return (0); |
