Remove 3rd argument to open() when flags don't include O_CREAT

ok deraadt@ ian@
pull/1/head
matthieu 2021-10-25 09:30:33 +00:00
parent 9d38683171
commit 59a8bd4e1a
3 changed files with 7 additions and 7 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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",