=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mail/popen.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- src/usr.bin/mail/popen.c 1997/07/14 16:09:07 1.10 +++ src/usr.bin/mail/popen.c 1997/08/04 19:25:50 1.11 @@ -1,4 +1,4 @@ -/* $OpenBSD: popen.c,v 1.10 1997/07/14 16:09:07 millert Exp $ */ +/* $OpenBSD: popen.c,v 1.11 1997/08/04 19:25:50 deraadt Exp $ */ /* $NetBSD: popen.c,v 1.6 1997/05/13 06:48:42 mikel Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)popen.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: popen.c,v 1.10 1997/07/14 16:09:07 millert Exp $"; +static char rcsid[] = "$OpenBSD: popen.c,v 1.11 1997/08/04 19:25:50 deraadt Exp $"; #endif #endif /* not lint */ @@ -346,6 +346,7 @@ int pid; union wait status; register struct child *cp; + int save_errno = errno; while ((pid = wait3((int *)&status, WNOHANG, (struct rusage *)0)) > 0) { @@ -357,6 +358,7 @@ cp->status = status; } } + errno = save_errno; } union wait wait_status;