mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-28 11:10:51 +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
9fd9116735
commit
35d26b824d
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>
|
2014-03-11 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Source/Additions/GSMime.m:
|
* 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__)
|
# define syslog(prio, msg,...) slogf(_SLOG_SETCODE(_SLOG_SYSLOG, 0), prio, msg, __VA_ARGS__)
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
static int log_priority;
|
static int log_priority = 0;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gdomap_log (int prio)
|
gdomap_log (int prio)
|
||||||
|
@ -4481,16 +4481,7 @@ main(int argc, char** argv)
|
||||||
const char *machine = 0;
|
const char *machine = 0;
|
||||||
const char *lookupf = 0;
|
const char *lookupf = 0;
|
||||||
int donamesf = 0;
|
int donamesf = 0;
|
||||||
|
int forked = 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
|
|
||||||
|
|
||||||
#if defined(__MINGW__)
|
#if defined(__MINGW__)
|
||||||
WORD wVersionRequested;
|
WORD wVersionRequested;
|
||||||
|
@ -4851,7 +4842,6 @@ printf(
|
||||||
#else
|
#else
|
||||||
if (nofork == 0)
|
if (nofork == 0)
|
||||||
{
|
{
|
||||||
is_daemon = 1;
|
|
||||||
/*
|
/*
|
||||||
* Now fork off child process to run in background.
|
* Now fork off child process to run in background.
|
||||||
*/
|
*/
|
||||||
|
@ -4865,6 +4855,7 @@ printf(
|
||||||
/*
|
/*
|
||||||
* Try to run in background.
|
* Try to run in background.
|
||||||
*/
|
*/
|
||||||
|
forked = 1;
|
||||||
#if defined(NeXT)
|
#if defined(NeXT)
|
||||||
setpgrp(0, getpid());
|
setpgrp(0, getpid());
|
||||||
#else
|
#else
|
||||||
|
@ -4924,6 +4915,19 @@ printf(
|
||||||
|
|
||||||
#endif /* !__MINGW__ */
|
#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_my_port(); /* Determine port to listen on. */
|
||||||
init_ports(); /* Create ports to handle requests. */
|
init_ports(); /* Create ports to handle requests. */
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue