From 7111b0acefc667e94cbfbcfc422e74791a80acbd Mon Sep 17 00:00:00 2001 From: Guy Helmer Date: Fri, 9 Jun 2000 19:38:28 +0000 Subject: [PATCH] O_NONBLOCK was used as a command with a bogus arg to fcntl(2). Change it to F_SETFD with an arg of 0 to clear O_NONBLOCK. PR: bin/8681 Submitted by: koyama takahiro Prompted by: Nathan Ahlstrom --- usr.bin/wall/ttymsg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/wall/ttymsg.c b/usr.bin/wall/ttymsg.c index 2b58a1b97eb8..a42ef412af98 100644 --- a/usr.bin/wall/ttymsg.c +++ b/usr.bin/wall/ttymsg.c @@ -120,7 +120,7 @@ ttymsg(iov, iovcnt, line, tmout) continue; } if (errno == EWOULDBLOCK) { - int cpid, off = 0; + int cpid; if (forked) { (void) close(fd); @@ -143,7 +143,7 @@ ttymsg(iov, iovcnt, line, tmout) (void) signal(SIGTERM, SIG_DFL); /* XXX */ (void) sigsetmask(0); (void) alarm((u_int)tmout); - (void) fcntl(fd, O_NONBLOCK, &off); + (void) fcntl(fd, F_SETFL, 0); /* clear O_NONBLOCK */ continue; } /*