diff options
| author | Werner Koch <[email protected]> | 2006-11-09 16:09:46 +0000 |
|---|---|---|
| committer | Werner Koch <[email protected]> | 2006-11-09 16:09:46 +0000 |
| commit | c1f4a8edff15737b15c209001d0130036416886d (patch) | |
| tree | 84477a2bdb7c1c803649e81e6e624f695ca3462e /agent/gpg-agent.c | |
| parent | post release updates (diff) | |
| download | gnupg-c1f4a8edff15737b15c209001d0130036416886d.tar.gz gnupg-c1f4a8edff15737b15c209001d0130036416886d.zip | |
gpg-agent.c (main): In detached mode connect standard descriptors to /dev/null.
Other minor fixes
Diffstat (limited to 'agent/gpg-agent.c')
| -rw-r--r-- | agent/gpg-agent.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c index 5201be8d5..979fa3564 100644 --- a/agent/gpg-agent.c +++ b/agent/gpg-agent.c @@ -1007,7 +1007,16 @@ main (int argc, char **argv ) for (i=0; i <= 2; i++) { if (!log_test_fd (i) && i != fd ) - close (i); + { + if ( ! close (i) + && open ("/dev/null", i? O_WRONLY : O_RDONLY) == -1) + { + log_error ("failed to open `%s': %s\n", + "/dev/null", strerror (errno)); + cleanup (); + exit (1); + } + } } if (setsid() == -1) { |
