diff options
author | deraadt <deraadt@openbsd.org> | 2015-11-12 22:33:07 +0000 |
---|---|---|
committer | deraadt <deraadt@openbsd.org> | 2015-11-12 22:33:07 +0000 |
commit | 06049e53b884250e68f9ea5b5220dae091a50b13 (patch) | |
tree | 5521b2a09da1c0fbef7ae26f20cf4e2fbe18f64a | |
parent | Rename overly-long utf8data to ud throughout. (diff) | |
download | wireguard-openbsd-06049e53b884250e68f9ea5b5220dae091a50b13.tar.xz wireguard-openbsd-06049e53b884250e68f9ea5b5220dae091a50b13.zip |
use symbolics for flags to open
from Ricardo Mestre
-rw-r--r-- | bin/ksh/jobs.c | 4 | ||||
-rw-r--r-- | sbin/badsect/badsect.c | 4 | ||||
-rw-r--r-- | usr.sbin/mrouted/main.c | 2 | ||||
-rw-r--r-- | usr.sbin/quot/quot.c | 4 | ||||
-rw-r--r-- | usr.sbin/ypserv/ypserv/ypserv.c | 6 |
5 files changed, 10 insertions, 10 deletions
diff --git a/bin/ksh/jobs.c b/bin/ksh/jobs.c index 8f50774c36d..a229f8cd25d 100644 --- a/bin/ksh/jobs.c +++ b/bin/ksh/jobs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: jobs.c,v 1.51 2015/11/12 04:04:31 mmcc Exp $ */ +/* $OpenBSD: jobs.c,v 1.52 2015/11/12 22:33:07 deraadt Exp $ */ /* * Process and job control @@ -520,7 +520,7 @@ exchild(struct op *t, int flags, volatile int *xerrok, setsig(&sigtraps[SIGQUIT], SIG_IGN, SS_RESTORE_IGN|SS_FORCE); if (!(flags & (XPIPEI | XCOPROC))) { - int fd = open("/dev/null", 0); + int fd = open("/dev/null", O_RDONLY); if (fd != 0) { (void) ksh_dup2(fd, 0, true); close(fd); diff --git a/sbin/badsect/badsect.c b/sbin/badsect/badsect.c index e7c06ab8b78..b9f2723e2f0 100644 --- a/sbin/badsect/badsect.c +++ b/sbin/badsect/badsect.c @@ -1,4 +1,4 @@ -/* $OpenBSD: badsect.c,v 1.26 2015/01/20 18:22:20 deraadt Exp $ */ +/* $OpenBSD: badsect.c,v 1.27 2015/11/12 22:33:07 deraadt Exp $ */ /* $NetBSD: badsect.c,v 1.10 1995/03/18 14:54:28 cgd Exp $ */ /* @@ -119,7 +119,7 @@ main(int argc, char *argv[]) err(5, "Cannot find dev 0%o corresponding to %s", stbuf.st_rdev, argv[1]); - if ((fsi = open(name, 0)) < 0) + if ((fsi = open(name, O_RDONLY)) < 0) err(6, "%s", name); fs = &sblock; diff --git a/usr.sbin/mrouted/main.c b/usr.sbin/mrouted/main.c index 4f1214e9b5c..299fab4ef31 100644 --- a/usr.sbin/mrouted/main.c +++ b/usr.sbin/mrouted/main.c @@ -139,7 +139,7 @@ usage: fprintf(stderr, (void)setpgrp(); #else #ifdef TIOCNOTTY - t = open("/dev/tty", 2); + t = open("/dev/tty", O_RDWR); if (t >= 0) { (void)ioctl(t, TIOCNOTTY, (char *)0); (void)close(t); diff --git a/usr.sbin/quot/quot.c b/usr.sbin/quot/quot.c index 18c9c0ff06a..896d8601634 100644 --- a/usr.sbin/quot/quot.c +++ b/usr.sbin/quot/quot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: quot.c,v 1.27 2015/08/20 22:39:29 deraadt Exp $ */ +/* $OpenBSD: quot.c,v 1.28 2015/11/12 22:33:07 deraadt Exp $ */ /* * Copyright (C) 1991, 1994 Wolfgang Solfrank. @@ -561,7 +561,7 @@ quot(char *name, char *mp) * XXX this is completely broken. Of course you can't read a * directory, well, not anymore. How to fix this, though... */ - if ((fd = open(name, 0)) < 0) { + if ((fd = open(name, O_RDONLY)) < 0) { warn("%s", name); return; } diff --git a/usr.sbin/ypserv/ypserv/ypserv.c b/usr.sbin/ypserv/ypserv/ypserv.c index 539e21ebfcd..107916e2568 100644 --- a/usr.sbin/ypserv/ypserv/ypserv.c +++ b/usr.sbin/ypserv/ypserv/ypserv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ypserv.c,v 1.42 2015/10/26 10:12:46 deraadt Exp $ */ +/* $OpenBSD: ypserv.c,v 1.43 2015/11/12 22:33:07 deraadt Exp $ */ /* * Copyright (c) 1994 Mats O Jansson <moj@stacken.kth.se> @@ -451,10 +451,10 @@ main(int argc, char *argv[]) if (pid) exit(0); closefrom(0); - i = open("/dev/console", 2); + i = open("/dev/console", O_RDWR); (void) dup2(i, 1); (void) dup2(i, 2); - i = open("/dev/tty", 2); + i = open("/dev/tty", O_RDWR); if (i >= 0) { (void) ioctl(i, TIOCNOTTY, NULL); (void) close(i); |