mirror of
https://github.com/openbsd/xenocara.git
synced 2025-12-13 12:49:07 +00:00
Remove 3rd argument to open() when flags don't include O_CREAT
ok deraadt@ ian@
This commit is contained in:
@@ -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>
|
* Copyright (c) 2010 Jacob Meuser <jakemsr@openbsd.org>
|
||||||
*
|
*
|
||||||
@@ -784,7 +784,7 @@ dev_check_caps(struct video *vid)
|
|||||||
struct dev *d = &vid->dev;
|
struct dev *d = &vid->dev;
|
||||||
struct v4l2_capability cap;
|
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);
|
warn("%s", d->path);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -1624,7 +1624,7 @@ setup(struct video *vid)
|
|||||||
if (!strcmp(vid->iofile, "-"))
|
if (!strcmp(vid->iofile, "-"))
|
||||||
vid->iofile_fd = STDIN_FILENO;
|
vid->iofile_fd = STDIN_FILENO;
|
||||||
else
|
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) {
|
} else if (vid->mode & M_OUT_FILE) {
|
||||||
if (!strcmp(vid->iofile, "-"))
|
if (!strcmp(vid->iofile, "-"))
|
||||||
vid->iofile_fd = STDOUT_FILENO;
|
vid->iofile_fd = STDOUT_FILENO;
|
||||||
|
|||||||
@@ -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 Federico G. Schwindt
|
||||||
* Copyright (c) 2005 Claudio Castiglia
|
* Copyright (c) 2005 Claudio Castiglia
|
||||||
@@ -345,7 +345,7 @@ main(int argc, char **argv)
|
|||||||
signal(SIGTERM, handler);
|
signal(SIGTERM, handler);
|
||||||
signal(SIGUSR1, handler);
|
signal(SIGUSR1, handler);
|
||||||
|
|
||||||
fd = open(_PATH_DEVNULL, O_RDWR, 0);
|
fd = open(_PATH_DEVNULL, O_RDWR);
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
err(1, _PATH_DEVNULL);
|
err(1, _PATH_DEVNULL);
|
||||||
dup2(fd, STDIN_FILENO);
|
dup2(fd, STDIN_FILENO);
|
||||||
|
|||||||
@@ -700,7 +700,7 @@ void parse_args(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (infilename) {
|
if (infilename) {
|
||||||
f = open(infilename, O_RDONLY|O_BINARY, 0);
|
f = open(infilename, O_RDONLY|O_BINARY);
|
||||||
if (f < 0) {
|
if (f < 0) {
|
||||||
fprintf(stderr, "xpr: error opening \"%s\" for input\n",
|
fprintf(stderr, "xpr: error opening \"%s\" for input\n",
|
||||||
infilename);
|
infilename);
|
||||||
@@ -716,7 +716,7 @@ void parse_args(
|
|||||||
if (!(*flags & F_APPEND)) {
|
if (!(*flags & F_APPEND)) {
|
||||||
f = open(output_filename, O_CREAT|O_WRONLY|O_TRUNC, 0664);
|
f = open(output_filename, O_CREAT|O_WRONLY|O_TRUNC, 0664);
|
||||||
} else {
|
} else {
|
||||||
f = open(output_filename, O_WRONLY, 0);
|
f = open(output_filename, O_WRONLY);
|
||||||
}
|
}
|
||||||
if (f < 0) {
|
if (f < 0) {
|
||||||
fprintf(stderr, "xpr: error opening \"%s\" for output\n",
|
fprintf(stderr, "xpr: error opening \"%s\" for output\n",
|
||||||
|
|||||||
Reference in New Issue
Block a user