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;
}
#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)
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)
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;
}
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) {
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;