summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2021-10-25 09:30:34 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2021-10-25 09:30:34 +0000
commit6cb581d1da73c851a6a2ad535f33a9745dc07217 (patch)
tree39ffc9a64f6e34ee3c0536d207a40ec120ad85f7
parente46ac0341c6f0ef544a483ae86a36a04bab84052 (diff)
Remove 3rd argument to open() when flags don't include O_CREAT
ok deraadt@ ian@
-rw-r--r--app/video/video.c6
-rw-r--r--app/xidle/xidle.c4
-rw-r--r--app/xpr/xpr.c4
3 files changed, 7 insertions, 7 deletions
diff --git a/app/video/video.c b/app/video/video.c
index 2cd9672a2..247adac78 100644
--- a/app/video/video.c
+++ b/app/video/video.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: video.c,v 1.40 2021/02/16 13:57:41 mglocker Exp $ */
+/* $OpenBSD: video.c,v 1.41 2021/10/25 09:30:33 matthieu Exp $ */
/*
* Copyright (c) 2010 Jacob Meuser <jakemsr@openbsd.org>
*
@@ -784,7 +784,7 @@ dev_check_caps(struct video *vid)
struct dev *d = &vid->dev;
struct v4l2_capability cap;
- if ((d->fd = open(d->path, O_RDWR, 0)) < 0) {
+ if ((d->fd = open(d->path, O_RDWR)) < 0) {
warn("%s", d->path);
return 0;
}
@@ -1624,7 +1624,7 @@ setup(struct video *vid)
if (!strcmp(vid->iofile, "-"))
vid->iofile_fd = STDIN_FILENO;
else
- vid->iofile_fd = open(vid->iofile, O_RDONLY, 0);
+ vid->iofile_fd = open(vid->iofile, O_RDONLY);
} else if (vid->mode & M_OUT_FILE) {
if (!strcmp(vid->iofile, "-"))
vid->iofile_fd = STDOUT_FILENO;
diff --git a/app/xidle/xidle.c b/app/xidle/xidle.c
index e2a842cd6..623ca784a 100644
--- a/app/xidle/xidle.c
+++ b/app/xidle/xidle.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xidle.c,v 1.9 2019/04/02 14:16:37 kn Exp $ */
+/* $OpenBSD: xidle.c,v 1.10 2021/10/25 09:30:33 matthieu Exp $ */
/*
* Copyright (c) 2005 Federico G. Schwindt
* Copyright (c) 2005 Claudio Castiglia
@@ -345,7 +345,7 @@ main(int argc, char **argv)
signal(SIGTERM, handler);
signal(SIGUSR1, handler);
- fd = open(_PATH_DEVNULL, O_RDWR, 0);
+ fd = open(_PATH_DEVNULL, O_RDWR);
if (fd < 0)
err(1, _PATH_DEVNULL);
dup2(fd, STDIN_FILENO);
diff --git a/app/xpr/xpr.c b/app/xpr/xpr.c
index 90b1b66d0..9acb77886 100644
--- a/app/xpr/xpr.c
+++ b/app/xpr/xpr.c
@@ -700,7 +700,7 @@ void parse_args(
}
if (infilename) {
- f = open(infilename, O_RDONLY|O_BINARY, 0);
+ f = open(infilename, O_RDONLY|O_BINARY);
if (f < 0) {
fprintf(stderr, "xpr: error opening \"%s\" for input\n",
infilename);
@@ -716,7 +716,7 @@ void parse_args(
if (!(*flags & F_APPEND)) {
f = open(output_filename, O_CREAT|O_WRONLY|O_TRUNC, 0664);
} else {
- f = open(output_filename, O_WRONLY, 0);
+ f = open(output_filename, O_WRONLY);
}
if (f < 0) {
fprintf(stderr, "xpr: error opening \"%s\" for output\n",