summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-01-03 17:32:11 +0000
committerGerald Carter <jerry@samba.org>2003-01-03 17:32:11 +0000
commitdf4af79c784fa3dbc14c8ca2eefc51c78a22e26b (patch)
treebab44414072172eee3c14b1ba758e9f7a4043e7c /source3/lib
parentfc744091d4cddb49024c542b77d140f2cb6cef4f (diff)
downloadsamba-df4af79c784fa3dbc14c8ca2eefc51c78a22e26b.tar.gz
samba-df4af79c784fa3dbc14c8ca2eefc51c78a22e26b.tar.bz2
samba-df4af79c784fa3dbc14c8ca2eefc51c78a22e26b.zip
patch to include support for daemontools from Michael Handler
(This used to be commit 4c48c475a28450ad4fd8dcc8263e841c0c39a80e)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/debug.c1
-rw-r--r--source3/lib/util.c9
2 files changed, 7 insertions, 3 deletions
diff --git a/source3/lib/debug.c b/source3/lib/debug.c
index 0836dbe790..2efdd3c2a3 100644
--- a/source3/lib/debug.c
+++ b/source3/lib/debug.c
@@ -525,6 +525,7 @@ void setup_logging(const char *pname, BOOL interactive)
if (interactive) {
stdout_logging = True;
dbf = x_stdout;
+ x_setbuf( x_stdout, NULL );
}
#ifdef WITH_SYSLOG
else {
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 67de9e4bf2..ec967e4abf 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -873,10 +873,13 @@ void msleep(unsigned int t)
Become a daemon, discarding the controlling terminal.
****************************************************************************/
-void become_daemon(void)
+void become_daemon(BOOL Fork)
{
- if (sys_fork())
- _exit(0);
+ if (Fork) {
+ if (sys_fork()) {
+ _exit(0);
+ }
+ }
/* detach from the terminal */
#ifdef HAVE_SETSID