diff options
author | Matthieu Herrb <matthieu@herrb.eu> | 2021-10-26 19:00:22 +0200 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2022-08-23 22:43:38 +0000 |
commit | cf54ebf6cf4badeb9f980b21c6f9d19e988b456e (patch) | |
tree | 0148623adfd93be0d92afd20f0f3451bdf3fa678 | |
parent | a64a176cfd62956cc4967aa2929db2526d4faee2 (diff) | |
download | libdrm-cf54ebf6cf4badeb9f980b21c6f9d19e988b456e.tar.gz libdrm-cf54ebf6cf4badeb9f980b21c6f9d19e988b456e.tar.bz2 libdrm-cf54ebf6cf4badeb9f980b21c6f9d19e988b456e.zip |
Remove unused 3rd parameter to open(2)
The 3rd parameter is only used with the O_CREAT flag
Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
-rw-r--r-- | tests/drmdevice.c | 2 | ||||
-rw-r--r-- | xf86drm.c | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/drmdevice.c b/tests/drmdevice.c index f1c1cd3a..b4b62d9c 100644 --- a/tests/drmdevice.c +++ b/tests/drmdevice.c @@ -142,7 +142,7 @@ main(void) for (int j = 0; j < DRM_NODE_MAX; j++) { if (devices[i]->available_nodes & 1 << j) { printf("--- Opening device node %s ---\n", devices[i]->nodes[j]); - fd = open(devices[i]->nodes[j], O_RDONLY | O_CLOEXEC, 0); + fd = open(devices[i]->nodes[j], O_RDONLY | O_CLOEXEC); if (fd < 0) { printf("Failed - %s (%d)\n", strerror(errno), errno); continue; @@ -849,7 +849,7 @@ wait_for_udev: } #endif - fd = open(buf, O_RDWR | O_CLOEXEC, 0); + fd = open(buf, O_RDWR | O_CLOEXEC); drmMsg("drmOpenDevice: open result is %d, (%s)\n", fd, fd < 0 ? strerror(errno) : "OK"); if (fd >= 0) @@ -869,7 +869,7 @@ wait_for_udev: chmod(buf, devmode); } } - fd = open(buf, O_RDWR | O_CLOEXEC, 0); + fd = open(buf, O_RDWR | O_CLOEXEC); drmMsg("drmOpenDevice: open result is %d, (%s)\n", fd, fd < 0 ? strerror(errno) : "OK"); if (fd >= 0) @@ -907,7 +907,7 @@ static int drmOpenMinor(int minor, int create, int type) return -EINVAL; sprintf(buf, dev_name, DRM_DIR_NAME, minor); - if ((fd = open(buf, O_RDWR | O_CLOEXEC, 0)) >= 0) + if ((fd = open(buf, O_RDWR | O_CLOEXEC)) >= 0) return fd; return -errno; } @@ -1135,7 +1135,7 @@ static int drmOpenByName(const char *name, int type) int retcode; sprintf(proc_name, "/proc/dri/%d/name", i); - if ((fd = open(proc_name, O_RDONLY, 0)) >= 0) { + if ((fd = open(proc_name, O_RDONLY)) >= 0) { retcode = read(fd, buf, sizeof(buf)-1); close(fd); if (retcode) { @@ -3892,7 +3892,7 @@ static int drmParsePciDeviceInfo(int maj, int min, if (get_sysctl_pci_bus_info(maj, min, &info) != 0) return -EINVAL; - fd = open("/dev/pci", O_RDONLY, 0); + fd = open("/dev/pci", O_RDONLY); if (fd < 0) return -errno; |