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

Fixes: 6ac21ba916 ('core: add infrastructure for spawning a helper process')
This commit is contained in:
Thomas Haller 2023-04-03 19:11:54 +02:00
parent a2db213a45
commit fd123315e5
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

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