From 8011f60c95dc26ccc1fd7ef2f6f5f34412a22b08 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 3 Apr 2023 19:24:05 +0200 Subject: [PATCH] core: fix setting non-blocking FD in nm_utils_spawn_helper() Fixes: df1d214b2ea7 ('clients: polkit-agent: implement polkit agent without using libpolkit') (cherry picked from commit 20bd6b68036b9696d39c96cb0c1600c42d8d4255) --- src/libnmc-base/nm-polkit-listener.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libnmc-base/nm-polkit-listener.c b/src/libnmc-base/nm-polkit-listener.c index e7972faa48..fbc2c7046d 100644 --- a/src/libnmc-base/nm-polkit-listener.c +++ b/src/libnmc-base/nm-polkit-listener.c @@ -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,