mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
gpg-agent.c (main): In detached mode connect standard descriptors to /dev/null.
Other minor fixes
This commit is contained in:
parent
fac4babd9d
commit
c1f4a8edff
4 changed files with 24 additions and 4 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue