diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2017-04-26 10:35:10 -0700 |
---|---|---|
committer | Stef Walter <stefw@gnome.org> | 2017-04-27 09:55:22 +0200 |
commit | 15ac2c4fbb68560844d0422c22e727cab8bb17ce (patch) | |
tree | a5db44ca5a13a789e31f2178a764a424a8bf6cbe /daemon | |
parent | 9db67ef6e39ac51d426dee91da3b9305670241e6 (diff) | |
download | gnome-keyring-15ac2c4fbb68560844d0422c22e727cab8bb17ce.tar.gz |
main: don't call close() with a negative value
When run_foreground = TRUE, fork_and_print_environment() will return -1,
which is assigned to parent_wakeup_fd.
Since we don't want to call close(-1), only close(parent_wakeup_fd) when
run_foreground = FALSE.
https://bugzilla.gnome.org/show_bug.cgi?id=781785
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/gkd-main.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/daemon/gkd-main.c b/daemon/gkd-main.c index 57b72a05..f2c371f7 100644 --- a/daemon/gkd-main.c +++ b/daemon/gkd-main.c @@ -1133,10 +1133,11 @@ main (int argc, char *argv[]) /* Print the environment and tell the parent we're done */ print_environment (); - close (parent_wakeup_fd); - if (!run_foreground) + if (!run_foreground) { + close (parent_wakeup_fd); redirect_fds_after_fork (); + } g_unix_signal_add (SIGTERM, on_signal_term, loop); g_unix_signal_add (SIGHUP, on_signal_term, loop); |