diff options
author | Thomas Haller <thaller@redhat.com> | 2023-04-03 19:11:54 +0200 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2023-04-06 13:02:33 +0200 |
commit | 63eef577167d415c0682c1907ae303dc20c426aa (patch) | |
tree | c67afc0ed3114f74331f26022c2e74ed62896394 | |
parent | 07efcc124fdd2741644a27866b0dff403cd52f63 (diff) | |
download | NetworkManager-63eef577167d415c0682c1907ae303dc20c426aa.tar.gz |
core: fix setting non-blocking FD in nm_utils_spawn_helper()
Fixes: 6ac21ba916b3 ('core: add infrastructure for spawning a helper process')
(cherry picked from commit fd123315e548cb4879bf4b3820d8a9d91d06674e)
-rw-r--r-- | src/core/nm-core-utils.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/nm-core-utils.c b/src/core/nm-core-utils.c index 15b3c6a80a..90c5ae43d6 100644 --- a/src/core/nm-core-utils.c +++ b/src/core/nm-core-utils.c @@ -5154,9 +5154,9 @@ nm_utils_spawn_helper(const char *const *args, g_source_attach(info->timeout_source, g_main_context_get_thread_default()); /* 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); |