summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2016-03-20 00:01:23 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2016-03-20 00:01:23 +0000
commit276cbad1f829d62d4f85498a058f5ea0cc61557f (patch)
tree5e320a1dd34c0104d488b776f4540ea2bad79709 /bin
parenta03665481d25c081209ea32e59ed23a80f839be2 (diff)
Currently we have about a 50/50 split over fcntl(n, F_GETFL [,0])
idioms. Adopt the more concise fcntl(n, F_GETFL) over fcntl(n, F_GETFL, 0) where it is obvious further investigation will not yield and even better way. Obviousness evaluation and ok guenther@
Diffstat (limited to 'bin')
-rw-r--r--bin/ksh/io.c4
-rw-r--r--bin/ksh/misc.c4
-rw-r--r--bin/ksh/shf.c6
3 files changed, 7 insertions, 7 deletions
diff --git a/bin/ksh/io.c b/bin/ksh/io.c
index 0f5e18a691a..16a0709f1ba 100644
--- a/bin/ksh/io.c
+++ b/bin/ksh/io.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: io.c,v 1.34 2015/12/14 13:59:42 tb Exp $ */
+/* $OpenBSD: io.c,v 1.35 2016/03/20 00:01:21 krw Exp $ */
/*
* shell buffered IO and formatted output
@@ -302,7 +302,7 @@ check_fd(char *name, int mode, const char **emsgp)
if (isdigit((unsigned char)name[0]) && !name[1]) {
fd = name[0] - '0';
- if ((fl = fcntl(fd, F_GETFL, 0)) < 0) {
+ if ((fl = fcntl(fd, F_GETFL)) < 0) {
if (emsgp)
*emsgp = "bad file descriptor";
return -1;
diff --git a/bin/ksh/misc.c b/bin/ksh/misc.c
index 00f5a644660..9ef6e648aa0 100644
--- a/bin/ksh/misc.c
+++ b/bin/ksh/misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: misc.c,v 1.54 2016/03/06 11:56:20 natano Exp $ */
+/* $OpenBSD: misc.c,v 1.55 2016/03/20 00:01:21 krw Exp $ */
/*
* Miscellaneous functions
@@ -1113,7 +1113,7 @@ reset_nonblock(int fd)
{
int flags;
- if ((flags = fcntl(fd, F_GETFL, 0)) < 0)
+ if ((flags = fcntl(fd, F_GETFL)) < 0)
return -1;
if (!(flags & O_NONBLOCK))
return 0;
diff --git a/bin/ksh/shf.c b/bin/ksh/shf.c
index b5834e07b9e..68be9b90190 100644
--- a/bin/ksh/shf.c
+++ b/bin/ksh/shf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: shf.c,v 1.30 2015/12/14 13:59:42 tb Exp $ */
+/* $OpenBSD: shf.c,v 1.31 2016/03/20 00:01:21 krw Exp $ */
/*
* Shell file I/O routines
@@ -79,7 +79,7 @@ shf_fdopen(int fd, int sflags, struct shf *shf)
/* use fcntl() to figure out correct read/write flags */
if (sflags & SHF_GETFL) {
- int flags = fcntl(fd, F_GETFL, 0);
+ int flags = fcntl(fd, F_GETFL);
if (flags < 0)
/* will get an error on first read/write */
@@ -136,7 +136,7 @@ shf_reopen(int fd, int sflags, struct shf *shf)
/* use fcntl() to figure out correct read/write flags */
if (sflags & SHF_GETFL) {
- int flags = fcntl(fd, F_GETFL, 0);
+ int flags = fcntl(fd, F_GETFL);
if (flags < 0)
/* will get an error on first read/write */