diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2016-04-05 21:24:03 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2016-04-05 21:24:03 +0000 |
commit | 9c9a3471c3ebf497bee9fd16ac3581c335429165 (patch) | |
tree | f23d6f14d190db3883f0123c645f3583237cc972 | |
parent | f5f92c19a5ed8a465fc27f2f30edc4410374597f (diff) |
Move more fcntl(,F_GETFL,0) -> fcntl(,F_GETFL).
No functional change.
ok guenther@
-rw-r--r-- | lib/libedit/read.c | 4 | ||||
-rw-r--r-- | lib/libpcap/pcap.c | 6 | ||||
-rw-r--r-- | usr.sbin/npppd/npppd/npppd_subr.c | 7 | ||||
-rw-r--r-- | usr.sbin/pppd/chat/chat.c | 10 | ||||
-rw-r--r-- | usr.sbin/radiusd/radiusd_module.c | 4 |
5 files changed, 15 insertions, 16 deletions
diff --git a/lib/libedit/read.c b/lib/libedit/read.c index cf3186d327c..048f57f0098 100644 --- a/lib/libedit/read.c +++ b/lib/libedit/read.c @@ -1,4 +1,4 @@ -/* $OpenBSD: read.c,v 1.29 2016/03/22 11:32:18 schwarze Exp $ */ +/* $OpenBSD: read.c,v 1.30 2016/04/05 21:24:02 krw Exp $ */ /* $NetBSD: read.c,v 1.81 2016/02/16 22:53:14 christos Exp $ */ /*- @@ -146,7 +146,7 @@ read__fixio(int fd __attribute__((__unused__)), int e) e = 0; #ifdef TRY_AGAIN #if defined(F_SETFL) && defined(O_NDELAY) - if ((e = fcntl(fd, F_GETFL, 0)) == -1) + if ((e = fcntl(fd, F_GETFL)) == -1) return -1; if (fcntl(fd, F_SETFL, e & ~O_NDELAY) == -1) diff --git a/lib/libpcap/pcap.c b/lib/libpcap/pcap.c index ff795ef3f53..4372e22ead7 100644 --- a/lib/libpcap/pcap.c +++ b/lib/libpcap/pcap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcap.c,v 1.17 2015/11/17 21:39:23 mmcc Exp $ */ +/* $OpenBSD: pcap.c,v 1.18 2016/04/05 21:24:02 krw Exp $ */ /* * Copyright (c) 1993, 1994, 1995, 1996, 1997, 1998 @@ -408,7 +408,7 @@ pcap_getnonblock(pcap_t *p, char *errbuf) { int fdflags; - fdflags = fcntl(p->fd, F_GETFL, 0); + fdflags = fcntl(p->fd, F_GETFL); if (fdflags == -1) { snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "F_GETFL: %s", pcap_strerror(errno)); @@ -425,7 +425,7 @@ pcap_setnonblock(pcap_t *p, int nonblock, char *errbuf) { int fdflags; - fdflags = fcntl(p->fd, F_GETFL, 0); + fdflags = fcntl(p->fd, F_GETFL); if (fdflags == -1) { snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "F_GETFL: %s", pcap_strerror(errno)); diff --git a/usr.sbin/npppd/npppd/npppd_subr.c b/usr.sbin/npppd/npppd/npppd_subr.c index db9877decb6..2c207c6a3ff 100644 --- a/usr.sbin/npppd/npppd/npppd_subr.c +++ b/usr.sbin/npppd/npppd/npppd_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: npppd_subr.c,v 1.17 2015/09/13 08:22:10 mpi Exp $ */ +/* $OpenBSD: npppd_subr.c,v 1.18 2016/04/05 21:24:02 krw Exp $ */ /*- * Copyright (c) 2009 Internet Initiative Japan Inc. @@ -140,7 +140,7 @@ in_route0(int type, struct in_addr *dest, struct in_addr *mask, char *cp, buf[sizeof(*rtm) + sizeof(struct sockaddr_in) * 3 + sizeof(dl_buf) + 128]; const char *strtype; - int rval, dummy, flags, sock; + int rval, flags, sock; sock = -1; @@ -231,8 +231,7 @@ in_route0(int type, struct in_addr *dest, struct in_addr *mask, goto fail; } - dummy = 0; - if ((flags = fcntl(sock, F_GETFL, dummy)) < 0) { + if ((flags = fcntl(sock, F_GETFL)) < 0) { log_printf(LOG_ERR, "fcntl(,F_GETFL) failed on %s : %m", __func__); goto fail; diff --git a/usr.sbin/pppd/chat/chat.c b/usr.sbin/pppd/chat/chat.c index 8092c485f69..9f4ac4dd698 100644 --- a/usr.sbin/pppd/chat/chat.c +++ b/usr.sbin/pppd/chat/chat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: chat.c,v 1.34 2016/03/16 15:41:11 krw Exp $ */ +/* $OpenBSD: chat.c,v 1.35 2016/04/05 21:24:02 krw Exp $ */ /* * Chat -- a program for automatic session establishment (i.e. dial @@ -468,7 +468,7 @@ int signo; alarmed = 1; /* Reset alarm to avoid race window */ signal(SIGALRM, sigalrm); /* that can cause hanging in read() */ - if ((flags = fcntl(0, F_GETFL, 0)) == -1) + if ((flags = fcntl(0, F_GETFL)) == -1) fatal(2, "Can't get file mode flags on stdin: %m"); if (fcntl(0, F_SETFL, flags | O_NONBLOCK) == -1) @@ -482,7 +482,7 @@ void unalarm() { int flags; - if ((flags = fcntl(0, F_GETFL, 0)) == -1) + if ((flags = fcntl(0, F_GETFL)) == -1) fatal(2, "Can't get file mode flags on stdin: %m"); if (fcntl(0, F_SETFL, flags & ~O_NONBLOCK) == -1) @@ -1139,7 +1139,7 @@ int get_char() logmsg("warning: read() on stdin returned %d", status); case -1: - if ((status = fcntl(0, F_GETFL, 0)) == -1) + if ((status = fcntl(0, F_GETFL)) == -1) fatal(2, "Can't get file mode flags on stdin: %m"); if (fcntl(0, F_SETFL, status & ~O_NONBLOCK) == -1) @@ -1167,7 +1167,7 @@ int c; logmsg("warning: write() on stdout returned %d", status); case -1: - if ((status = fcntl(0, F_GETFL, 0)) == -1) + if ((status = fcntl(0, F_GETFL)) == -1) fatal(2, "Can't get file mode flags on stdin, %m"); if (fcntl(0, F_SETFL, status & ~O_NONBLOCK) == -1) diff --git a/usr.sbin/radiusd/radiusd_module.c b/usr.sbin/radiusd/radiusd_module.c index a7968a9337a..2e37d09e7ad 100644 --- a/usr.sbin/radiusd/radiusd_module.c +++ b/usr.sbin/radiusd/radiusd_module.c @@ -1,4 +1,4 @@ -/* $OpenBSD: radiusd_module.c,v 1.9 2015/12/05 13:22:32 claudio Exp $ */ +/* $OpenBSD: radiusd_module.c,v 1.10 2016/04/05 21:24:02 krw Exp $ */ /* * Copyright (c) 2015 YASUOKA Masahiko <yasuoka@yasuoka.net> @@ -102,7 +102,7 @@ module_start(struct module_base *base) #ifdef USE_LIBEVENT int ival; - if ((ival = fcntl(base->ibuf.fd, F_GETFL, 0)) < 0) + if ((ival = fcntl(base->ibuf.fd, F_GETFL)) < 0) err(1, "Failed to F_GETFL"); if (fcntl(base->ibuf.fd, F_SETFL, ival | O_NONBLOCK) < 0) err(1, "Failed to setup NONBLOCK"); |