mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 09:04:13 +00:00
fix for bug #41751
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37756 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
043e47a982
commit
88d1b8fd99
2 changed files with 21 additions and 12 deletions
|
@ -1,3 +1,8 @@
|
|||
2014-03-19 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Tools/gdomap.c: Don't open syslog connection until after we have
|
||||
forked and closed old descriptors .. fix for bug #41751
|
||||
|
||||
2014-03-11 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/Additions/GSMime.m:
|
||||
|
|
|
@ -296,7 +296,7 @@ static char ebuf[2048];
|
|||
# define syslog(prio, msg,...) slogf(_SLOG_SETCODE(_SLOG_SYSLOG, 0), prio, msg, __VA_ARGS__)
|
||||
# endif
|
||||
|
||||
static int log_priority;
|
||||
static int log_priority = 0;
|
||||
|
||||
static void
|
||||
gdomap_log (int prio)
|
||||
|
@ -4481,16 +4481,7 @@ main(int argc, char** argv)
|
|||
const char *machine = 0;
|
||||
const char *lookupf = 0;
|
||||
int donamesf = 0;
|
||||
|
||||
#if defined(HAVE_SYSLOG)
|
||||
/* Initially, gdomap_log errors to stderr as well as to syslogd. */
|
||||
#if defined(SYSLOG_4_2)
|
||||
openlog ("gdomap", LOG_NDELAY);
|
||||
log_priority = LOG_DAEMON;
|
||||
#elif !defined(HAVE_SLOGF)
|
||||
openlog ("gdomap", LOG_NDELAY, LOG_DAEMON);
|
||||
#endif
|
||||
#endif
|
||||
int forked = 0;
|
||||
|
||||
#if defined(__MINGW__)
|
||||
WORD wVersionRequested;
|
||||
|
@ -4851,7 +4842,6 @@ printf(
|
|||
#else
|
||||
if (nofork == 0)
|
||||
{
|
||||
is_daemon = 1;
|
||||
/*
|
||||
* Now fork off child process to run in background.
|
||||
*/
|
||||
|
@ -4865,6 +4855,7 @@ printf(
|
|||
/*
|
||||
* Try to run in background.
|
||||
*/
|
||||
forked = 1;
|
||||
#if defined(NeXT)
|
||||
setpgrp(0, getpid());
|
||||
#else
|
||||
|
@ -4924,6 +4915,19 @@ printf(
|
|||
|
||||
#endif /* !__MINGW__ */
|
||||
|
||||
if (forked)
|
||||
{
|
||||
is_daemon = 1;
|
||||
#if defined(HAVE_SYSLOG)
|
||||
#if defined(SYSLOG_4_2)
|
||||
openlog ("gdomap", LOG_NDELAY);
|
||||
log_priority = LOG_DAEMON;
|
||||
#elif !defined(HAVE_SLOGF)
|
||||
openlog ("gdomap", LOG_NDELAY, LOG_DAEMON);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
init_my_port(); /* Determine port to listen on. */
|
||||
init_ports(); /* Create ports to handle requests. */
|
||||
|
||||
|
|
Loading…
Reference in a new issue