From 669fc4e5c5d1f8b96eb62695e09354486f7bfc4c Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 31 May 2018 12:04:37 +0200 Subject: [PATCH] =?utf8?q?tree-wide:=20some=20O=5FNDELAY=20=E2=86=92=20O?= =?utf8?q?=5FNONBLOCK=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Somehow the coccinelle script misses these, hence fix them manually. --- src/nspawn/nspawn.c | 4 ++-- src/run/run.c | 2 +- src/tmpfiles/tmpfiles.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index 2548c989a9..5792ae9587 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -1952,7 +1952,7 @@ static int setup_kmsg(int kmsg_socket) { if (r < 0) return r; - fd = open(from, O_RDWR|O_NDELAY|O_CLOEXEC); + fd = open(from, O_RDWR|O_NONBLOCK|O_CLOEXEC); if (fd < 0) return log_error_errno(errno, "Failed to open fifo: %m"); @@ -4478,7 +4478,7 @@ int main(int argc, char *argv[]) { isatty(STDIN_FILENO) > 0 && isatty(STDOUT_FILENO) > 0; - master = posix_openpt(O_RDWR|O_NOCTTY|O_CLOEXEC|O_NDELAY); + master = posix_openpt(O_RDWR|O_NOCTTY|O_CLOEXEC|O_NONBLOCK); if (master < 0) { r = log_error_errno(errno, "Failed to acquire pseudo tty: %m"); goto finish; diff --git a/src/run/run.c b/src/run/run.c index 6a271eed75..733daffb8c 100644 --- a/src/run/run.c +++ b/src/run/run.c @@ -917,7 +917,7 @@ static int start_transient_service( if (arg_stdio == ARG_STDIO_PTY) { if (arg_transport == BUS_TRANSPORT_LOCAL) { - master = posix_openpt(O_RDWR|O_NOCTTY|O_CLOEXEC|O_NDELAY); + master = posix_openpt(O_RDWR|O_NOCTTY|O_CLOEXEC|O_NONBLOCK); if (master < 0) return log_error_errno(errno, "Failed to acquire pseudo tty: %m"); diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index 049e24b8bd..ae39d720a2 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -1245,7 +1245,7 @@ static int write_one_file(Item *i, const char *path) { RUN_WITH_UMASK(0000) { mac_selinux_create_file_prepare(path, S_IFREG); - fd = open(path, flags|O_NDELAY|O_CLOEXEC|O_WRONLY|O_NOCTTY, i->mode); + fd = open(path, flags|O_NONBLOCK|O_CLOEXEC|O_WRONLY|O_NOCTTY, i->mode); mac_selinux_create_file_clear(); } -- 2.25.1