diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-07-08 21:45:05 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-07-08 21:45:05 +0000 |
commit | 5d7745af6274ad1c61f601a05048c86ed26cf8a9 (patch) | |
tree | 26e2f10ebb639830b2edfdbb73c8215896a45aee /usr.sbin | |
parent | 758e515b3bba269df3fa3c77d6d97c050141c435 (diff) |
handle fork() failure; mrg
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/sliplogin/sliplogin.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/usr.sbin/sliplogin/sliplogin.c b/usr.sbin/sliplogin/sliplogin.c index 0ee7c46f156..9cd28ee6918 100644 --- a/usr.sbin/sliplogin/sliplogin.c +++ b/usr.sbin/sliplogin/sliplogin.c @@ -39,7 +39,7 @@ char copyright[] = #ifndef lint /*static char sccsid[] = "from: @(#)sliplogin.c 5.6 (Berkeley) 3/2/91";*/ -static char rcsid[] = "$Id: sliplogin.c,v 1.7 1998/01/21 00:25:26 deraadt Exp $"; +static char rcsid[] = "$Id: sliplogin.c,v 1.8 1998/07/08 21:45:04 deraadt Exp $"; #endif /* not lint */ /* @@ -239,8 +239,15 @@ main(argc, argv) * and ensure that the slip line is our controlling terminal. */ #ifdef POSIX - if (fork() > 0) + switch (fork()) { + case -1: + perror("fork"); + exit(1); + case 0: + break; + default: exit(0); + } if (setsid() == -1) perror("setsid"); #else |