=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/xargs/xargs.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- src/usr.bin/xargs/xargs.c 2003/06/13 16:54:00 1.16 +++ src/usr.bin/xargs/xargs.c 2003/07/15 23:30:47 1.17 @@ -1,4 +1,4 @@ -/* $OpenBSD: xargs.c,v 1.16 2003/06/13 16:54:00 millert Exp $ */ +/* $OpenBSD: xargs.c,v 1.17 2003/07/15 23:30:47 tedu Exp $ */ /* $FreeBSD: xargs.c,v 1.51 2003/05/03 19:09:11 obrien Exp $ */ /*- @@ -45,7 +45,7 @@ #if 0 static const char sccsid[] = "@(#)xargs.c 8.1 (Berkeley) 6/6/93"; #else -static const char rcsid[] = "$OpenBSD: xargs.c,v 1.16 2003/06/13 16:54:00 millert Exp $"; +static const char rcsid[] = "$OpenBSD: xargs.c,v 1.17 2003/07/15 23:30:47 tedu Exp $"; #endif #endif /* not lint */ @@ -523,14 +523,18 @@ err(1, "vfork"); case 0: if (oflag) { - if ((fd = open(_PATH_TTY, O_RDONLY)) == -1) - err(1, "can't open /dev/tty"); + if ((fd = open(_PATH_TTY, O_RDONLY)) == -1) { + warn("can't open /dev/tty"); + _exit(1); + } } else { fd = open(_PATH_DEVNULL, O_RDONLY); } if (fd > STDIN_FILENO) { - if (dup2(fd, STDIN_FILENO) != 0) - err(1, "can't dup2 to stdin"); + if (dup2(fd, STDIN_FILENO) != 0) { + warn("can't dup2 to stdin"); + _exit(1); + } close(fd); } execvp(argv[0], argv);