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

Fixes: df1d214b2e ('clients: polkit-agent: implement polkit agent without using libpolkit')
(cherry picked from commit 20bd6b6803)
This commit is contained in:
Thomas Haller 2023-04-03 19:24:05 +02:00 committed by Lubomir Rintel
parent 7d75ae5d34
commit 8011f60c95

View file

@ -534,10 +534,10 @@ begin_authentication(AuthRequest *request)
return;
}
fd_flags = fcntl(request->child_stdin, F_GETFD, 0);
fd_flags = fcntl(request->child_stdin, F_GETFL, 0);
fcntl(request->child_stdin, F_SETFL, fd_flags | O_NONBLOCK);
fd_flags = fcntl(request->child_stdout, F_GETFD, 0);
fd_flags = fcntl(request->child_stdout, F_GETFL, 0);
fcntl(request->child_stdout, F_SETFL, fd_flags | O_NONBLOCK);
request->child_stdout_watch_source = nm_g_unix_fd_source_new(request->child_stdout,