summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-11-12 22:33:08 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-11-12 22:33:08 +0000
commit7702ab28048cdb117b42b65f699c2c7c4b3082e2 (patch)
tree71fa199533387030df2e9648d742dc61ca562427 /usr.sbin
parent1ca9198b8eb973d8e8413720e3068a18de279912 (diff)
use symbolics for flags to open
from Ricardo Mestre
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/mrouted/main.c2
-rw-r--r--usr.sbin/quot/quot.c4
-rw-r--r--usr.sbin/ypserv/ypserv/ypserv.c6
3 files changed, 6 insertions, 6 deletions
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);