core: fix setting non-blocking FD in nm_utils_spawn_helper()

Fixes: 6ac21ba916 ('core: add infrastructure for spawning a helper process')
(cherry picked from commit fd123315e5)
This commit is contained in:
Thomas Haller 2023-04-03 19:11:54 +02:00 committed by Lubomir Rintel
parent 07efcc124f
commit 63eef57716

View file

@ -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);