chiark / gitweb /
coccinelle: O_NDELAY → O_NONBLOCK
authorLennart Poettering <lennart@poettering.net>
Wed, 24 Jan 2018 10:09:29 +0000 (11:09 +0100)
committerSven Eden <yamakuzure@gmx.net>
Wed, 30 May 2018 05:50:18 +0000 (07:50 +0200)
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.

src/login/logind-inhibit.c
src/login/logind-session.c
src/shared/utmp-wtmp.c

index 8a6487ea45e899ab51e06ceed45354cb44982050..e14835292e6b75e5aca82c18495749ea09dbc748 100644 (file)
@@ -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;
 
index 7addb3070d8519864e287121224c8785cf859b33..6a3b71ccce26c77934f33e8a5899bb05730a146a 100644 (file)
@@ -1020,7 +1020,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;
 
@@ -1039,7 +1039,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;
 
index 1715c0fb24ce50f4b3333b43f000d7e1259660c4..cab1cd6a2d147032635a9c8f578918ce94cda1c2 100644 (file)
@@ -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;