From: Lennart Poettering Date: Wed, 24 Jan 2018 10:09:29 +0000 (+0100) Subject: coccinelle: O_NDELAY → O_NONBLOCK X-Git-Tag: v237~29^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=db4a47e9fec86a3095129ce4b062b6ec81933eab;p=platform%2Fupstream%2Fsystemd.git 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. --- diff --git a/coccinelle/o-ndelay.occi b/coccinelle/o-ndelay.occi new file mode 100644 index 0000000..669424a --- /dev/null +++ b/coccinelle/o-ndelay.occi @@ -0,0 +1,4 @@ +@@ +@@ +- O_NDELAY ++ O_NONBLOCK diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c index 74536e1..5cd58e8 100644 --- a/src/journal/journald-server.c +++ b/src/journal/journald-server.c @@ -1497,7 +1497,8 @@ static int server_open_hostname(Server *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) return log_error_errno(errno, "Failed to open /proc/sys/kernel/hostname: %m"); diff --git a/src/login/logind-inhibit.c b/src/login/logind-inhibit.c index 8a6487e..e148352 100644 --- a/src/login/logind-inhibit.c +++ b/src/login/logind-inhibit.c @@ -305,7 +305,7 @@ int inhibitor_create_fifo(Inhibitor *i) { /* Open reading side */ 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) return -errno; } @@ -321,7 +321,7 @@ int inhibitor_create_fifo(Inhibitor *i) { } /* 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) return -errno; diff --git a/src/login/logind-session.c b/src/login/logind-session.c index c4bde80..92eb294 100644 --- a/src/login/logind-session.c +++ b/src/login/logind-session.c @@ -962,7 +962,7 @@ int session_create_fifo(Session *s) { /* Open reading side */ 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) return -errno; @@ -981,7 +981,7 @@ int session_create_fifo(Session *s) { } /* 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) return -errno; diff --git a/src/resolve/resolved-manager.c b/src/resolve/resolved-manager.c index 1311f04..2ee0277 100644 --- a/src/resolve/resolved-manager.c +++ b/src/resolve/resolved-manager.c @@ -488,7 +488,8 @@ static int manager_watch_hostname(Manager *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) { log_warning_errno(errno, "Failed to watch hostname: %m"); return 0; diff --git a/src/shared/utmp-wtmp.c b/src/shared/utmp-wtmp.c index 1715c0f..cab1cd6 100644 --- a/src/shared/utmp-wtmp.c +++ b/src/shared/utmp-wtmp.c @@ -330,7 +330,7 @@ static int write_to_terminal(const char *tty, const char *message) { assert(tty); 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)) return -errno; diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index adfb1f0..30077d3 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -8352,7 +8352,7 @@ static int talk_initctl(void) { 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 (errno == ENOENT) return 0;