From fd123315e548cb4879bf4b3820d8a9d91d06674e Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 3 Apr 2023 19:11:54 +0200 Subject: [PATCH] core: fix setting non-blocking FD in nm_utils_spawn_helper() Fixes: 6ac21ba916b3 ('core: add infrastructure for spawning a helper process') --- src/core/nm-core-utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/nm-core-utils.c b/src/core/nm-core-utils.c index 7482292034..410fb2bc29 100644 --- a/src/core/nm-core-utils.c +++ b/src/core/nm-core-utils.c @@ -5163,9 +5163,9 @@ nm_utils_spawn_helper(const char *const *args, g_source_attach(info->timeout_source, context); /* Set file descriptors as non-blocking */ - fd_flags = fcntl(info->child_stdin, F_GETFD, 0); + fd_flags = fcntl(info->child_stdin, F_GETFL, 0); fcntl(info->child_stdin, F_SETFL, fd_flags | O_NONBLOCK); - fd_flags = fcntl(info->child_stdout, F_GETFD, 0); + fd_flags = fcntl(info->child_stdout, F_GETFL, 0); fcntl(info->child_stdout, F_SETFL, fd_flags | O_NONBLOCK); fd_flags = fcntl(info->child_stderr, F_GETFD, 0); fcntl(info->child_stderr, F_SETFL, fd_flags | O_NONBLOCK);