coccinelle: O_NDELAY → O_NONBLOCK
Apparently O_NONBLOCK is the modern name used in most documentation and for most cases in our sources. Let's hence replace the old alias O_NDELAY and stick to O_NONBLOCK everywhere.
This commit is contained in:
parent
81b1dc271f
commit
db4a47e9fe
4
coccinelle/o-ndelay.occi
Normal file
4
coccinelle/o-ndelay.occi
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
@@
|
||||||
|
@@
|
||||||
|
- O_NDELAY
|
||||||
|
+ O_NONBLOCK
|
|
@ -1497,7 +1497,8 @@ static int server_open_hostname(Server *s) {
|
||||||
|
|
||||||
assert(s);
|
assert(s);
|
||||||
|
|
||||||
s->hostname_fd = open("/proc/sys/kernel/hostname", O_RDONLY|O_CLOEXEC|O_NDELAY|O_NOCTTY);
|
s->hostname_fd = open("/proc/sys/kernel/hostname",
|
||||||
|
O_RDONLY|O_CLOEXEC|O_NONBLOCK|O_NOCTTY);
|
||||||
if (s->hostname_fd < 0)
|
if (s->hostname_fd < 0)
|
||||||
return log_error_errno(errno, "Failed to open /proc/sys/kernel/hostname: %m");
|
return log_error_errno(errno, "Failed to open /proc/sys/kernel/hostname: %m");
|
||||||
|
|
||||||
|
|
|
@ -305,7 +305,7 @@ int inhibitor_create_fifo(Inhibitor *i) {
|
||||||
|
|
||||||
/* Open reading side */
|
/* Open reading side */
|
||||||
if (i->fifo_fd < 0) {
|
if (i->fifo_fd < 0) {
|
||||||
i->fifo_fd = open(i->fifo_path, O_RDONLY|O_CLOEXEC|O_NDELAY);
|
i->fifo_fd = open(i->fifo_path, O_RDONLY|O_CLOEXEC|O_NONBLOCK);
|
||||||
if (i->fifo_fd < 0)
|
if (i->fifo_fd < 0)
|
||||||
return -errno;
|
return -errno;
|
||||||
}
|
}
|
||||||
|
@ -321,7 +321,7 @@ int inhibitor_create_fifo(Inhibitor *i) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Open writing side */
|
/* Open writing side */
|
||||||
r = open(i->fifo_path, O_WRONLY|O_CLOEXEC|O_NDELAY);
|
r = open(i->fifo_path, O_WRONLY|O_CLOEXEC|O_NONBLOCK);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return -errno;
|
return -errno;
|
||||||
|
|
||||||
|
|
|
@ -962,7 +962,7 @@ int session_create_fifo(Session *s) {
|
||||||
|
|
||||||
/* Open reading side */
|
/* Open reading side */
|
||||||
if (s->fifo_fd < 0) {
|
if (s->fifo_fd < 0) {
|
||||||
s->fifo_fd = open(s->fifo_path, O_RDONLY|O_CLOEXEC|O_NDELAY);
|
s->fifo_fd = open(s->fifo_path, O_RDONLY|O_CLOEXEC|O_NONBLOCK);
|
||||||
if (s->fifo_fd < 0)
|
if (s->fifo_fd < 0)
|
||||||
return -errno;
|
return -errno;
|
||||||
|
|
||||||
|
@ -981,7 +981,7 @@ int session_create_fifo(Session *s) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Open writing side */
|
/* Open writing side */
|
||||||
r = open(s->fifo_path, O_WRONLY|O_CLOEXEC|O_NDELAY);
|
r = open(s->fifo_path, O_WRONLY|O_CLOEXEC|O_NONBLOCK);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return -errno;
|
return -errno;
|
||||||
|
|
||||||
|
|
|
@ -488,7 +488,8 @@ static int manager_watch_hostname(Manager *m) {
|
||||||
|
|
||||||
assert(m);
|
assert(m);
|
||||||
|
|
||||||
m->hostname_fd = open("/proc/sys/kernel/hostname", O_RDONLY|O_CLOEXEC|O_NDELAY|O_NOCTTY);
|
m->hostname_fd = open("/proc/sys/kernel/hostname",
|
||||||
|
O_RDONLY|O_CLOEXEC|O_NONBLOCK|O_NOCTTY);
|
||||||
if (m->hostname_fd < 0) {
|
if (m->hostname_fd < 0) {
|
||||||
log_warning_errno(errno, "Failed to watch hostname: %m");
|
log_warning_errno(errno, "Failed to watch hostname: %m");
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -330,7 +330,7 @@ static int write_to_terminal(const char *tty, const char *message) {
|
||||||
assert(tty);
|
assert(tty);
|
||||||
assert(message);
|
assert(message);
|
||||||
|
|
||||||
fd = open(tty, O_WRONLY|O_NDELAY|O_NOCTTY|O_CLOEXEC);
|
fd = open(tty, O_WRONLY|O_NONBLOCK|O_NOCTTY|O_CLOEXEC);
|
||||||
if (fd < 0 || !isatty(fd))
|
if (fd < 0 || !isatty(fd))
|
||||||
return -errno;
|
return -errno;
|
||||||
|
|
||||||
|
|
|
@ -8352,7 +8352,7 @@ static int talk_initctl(void) {
|
||||||
|
|
||||||
request.runlevel = rl;
|
request.runlevel = rl;
|
||||||
|
|
||||||
fd = open(INIT_FIFO, O_WRONLY|O_NDELAY|O_CLOEXEC|O_NOCTTY);
|
fd = open(INIT_FIFO, O_WRONLY|O_NONBLOCK|O_CLOEXEC|O_NOCTTY);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
if (errno == ENOENT)
|
if (errno == ENOENT)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue