From accbe49470ac49c36f7dabdf8bcfcced3a47b9a8 Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Thu, 2 Sep 2004 21:41:57 +0000 Subject: [PATCH] Pass O_NONBLOCK directly to fcntl() rather than the pointer to an int holding the value O_NONBLOCK. This worked previously because I was lucky. --- tools/regression/sockets/kqueue/kqueue.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/tools/regression/sockets/kqueue/kqueue.c b/tools/regression/sockets/kqueue/kqueue.c index e1f6a9cd7cb2..4c94ec0ab56e 100644 --- a/tools/regression/sockets/kqueue/kqueue.c +++ b/tools/regression/sockets/kqueue/kqueue.c @@ -240,10 +240,9 @@ main(int argc, char *argv[]) if (socketpair(PF_UNIX, SOCK_DGRAM, 0, sv) == -1) fail(errno, "socketpair", "PF_UNIX, SOCK_DGRAM", NULL); - i = O_NONBLOCK; - if (fcntl(sv[0], F_SETFL, &i) != 0) + if (fcntl(sv[0], F_SETFL, O_NONBLOCK) != 0) fail(errno, "fcntl", "PF_UNIX, SOCK_DGRAM", "O_NONBLOCK"); - if (fcntl(sv[1], F_SETFL, &i) != 0) + if (fcntl(sv[1], F_SETFL, O_NONBLOCK) != 0) fail(errno, "fcntl", "PF_UNIX, SOCK_DGRAM", "O_NONBLOCK"); test_evfilt_read(kq, sv, "PF_UNIX, SOCK_DGRAM"); @@ -267,10 +266,9 @@ main(int argc, char *argv[]) if (socketpair(PF_UNIX, SOCK_DGRAM, 0, sv) == -1) fail(errno, "socketpair", "PF_UNIX, SOCK_DGRAM", NULL); - i = O_NONBLOCK; - if (fcntl(sv[0], F_SETFL, &i) != 0) + if (fcntl(sv[0], F_SETFL, O_NONBLOCK) != 0) fail(errno, "fcntl", "PF_UNIX, SOCK_DGRAM", "O_NONBLOCK"); - if (fcntl(sv[1], F_SETFL, &i) != 0) + if (fcntl(sv[1], F_SETFL, O_NONBLOCK) != 0) fail(errno, "fcntl", "PF_UNIX, SOCK_DGRAM", "O_NONBLOCK"); test_evfilt_write(kq, sv, "PF_UNIX, SOCK_DGRAM"); @@ -288,10 +286,9 @@ main(int argc, char *argv[]) if (socketpair(PF_UNIX, SOCK_STREAM, 0, sv) == -1) fail(errno, "socketpair", "PF_UNIX, SOCK_STREAM", NULL); - i = O_NONBLOCK; - if (fcntl(sv[0], F_SETFL, &i) != 0) + if (fcntl(sv[0], F_SETFL, O_NONBLOCK) != 0) fail(errno, "fcntl", "PF_UNIX, SOCK_STREAM", "O_NONBLOCK"); - if (fcntl(sv[1], F_SETFL, &i) != 0) + if (fcntl(sv[1], F_SETFL, O_NONBLOCK) != 0) fail(errno, "fcntl", "PF_UNIX, SOCK_STREAM", "O_NONBLOCK"); test_evfilt_read(kq, sv, "PF_UNIX, SOCK_STREAM"); @@ -308,10 +305,9 @@ main(int argc, char *argv[]) if (socketpair(PF_UNIX, SOCK_STREAM, 0, sv) == -1) fail(errno, "socketpair", "PF_UNIX, SOCK_STREAM", NULL); - i = O_NONBLOCK; - if (fcntl(sv[0], F_SETFL, &i) != 0) + if (fcntl(sv[0], F_SETFL, O_NONBLOCK) != 0) fail(errno, "fcntl", "PF_UNIX, SOCK_STREAM", "O_NONBLOCK"); - if (fcntl(sv[1], F_SETFL, &i) != 0) + if (fcntl(sv[1], F_SETFL, O_NONBLOCK) != 0) fail(errno, "fcntl", "PF_UNIX, SOCK_STREAM", "O_NONBLOCK"); test_evfilt_write(kq, sv, "PF_UNIX, SOCK_STREAM");