diff options
author | 2005-12-12 20:10:53 +0000 | |
---|---|---|
committer | 2005-12-12 20:10:53 +0000 | |
commit | d090f8233714ef7a0447ed1194b82ab097d42c99 (patch) | |
tree | f1f47bb3051d10ddaee13e461676f2c6659b1bd9 /usr.bin/script/script.c | |
parent | One procfs.h leftover there, too. (diff) | |
download | wireguard-openbsd-d090f8233714ef7a0447ed1194b82ab097d42c99.tar.xz wireguard-openbsd-d090f8233714ef7a0447ed1194b82ab097d42c99.zip |
in the write codepaths, errors other than EAGAIN are fatal to the loop; ok otto
Diffstat (limited to 'usr.bin/script/script.c')
-rw-r--r-- | usr.bin/script/script.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/script/script.c b/usr.bin/script/script.c index df99958634f..885c3a48d54 100644 --- a/usr.bin/script/script.c +++ b/usr.bin/script/script.c @@ -1,4 +1,4 @@ -/* $OpenBSD: script.c,v 1.23 2005/04/11 19:59:07 deraadt Exp $ */ +/* $OpenBSD: script.c,v 1.24 2005/12/12 20:10:53 deraadt Exp $ */ /* $NetBSD: script.c,v 1.3 1994/12/21 08:55:43 jtc Exp $ */ /* @@ -65,7 +65,7 @@ static const char copyright[] = #if 0 static const char sccsid[] = "@(#)script.c 8.1 (Berkeley) 6/6/93"; #endif -static const char rcsid[] = "$OpenBSD: script.c,v 1.23 2005/04/11 19:59:07 deraadt Exp $"; +static const char rcsid[] = "$OpenBSD: script.c,v 1.24 2005/12/12 20:10:53 deraadt Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -188,6 +188,8 @@ main(int argc, char *argv[]) break; for (off = 0; off < cc; ) { ssize_t n = write(master, ibuf + off, cc - off); + if (n == -1 && errno != EAGAIN) + break; if (n == 0) break; /* skip writing */ if (n > 0) @@ -273,6 +275,8 @@ dooutput(void) sigprocmask(SIG_BLOCK, &blkalrm, NULL); for (off = 0; off < cc; ) { ssize_t n = write(STDOUT_FILENO, obuf + off, cc - off); + if (n == -1 && errno != EAGAIN) + break; if (n == 0) break; /* skip writing */ if (n > 0) |