From 2cf165db8bbcf43d9be3404f9566d523c8d6e323 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Thu, 5 Jan 2006 21:49:22 +0000 Subject: [PATCH] ifdef-protect setpgid and setsid. git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/ossman@406 fefdeb5f-60dc-0310-8127-8f9354f1896f --- configure.ac | 2 +- polyp/main.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 5f8da07..1899e92 100644 --- a/configure.ac +++ b/configure.ac @@ -168,7 +168,7 @@ AC_FUNC_FORK AC_FUNC_GETGROUPS AC_FUNC_SELECT_ARGTYPES AC_CHECK_FUNCS([getaddrinfo getgrgid_r getpwuid_r gettimeofday getuid \ - inet_ntop nanosleep sigaction sleep]) + inet_ntop nanosleep setpgid setsid sigaction sleep]) AC_CHECK_FUNCS([mkfifo], [HAVE_MKFIFO=1], [HAVE_MKFIFO=0]) AM_CONDITIONAL(HAVE_MKFIFO, test "x$HAVE_MKFIFO" = "x1") diff --git a/polyp/main.c b/polyp/main.c index 2e97e5c..a56d2f1 100644 --- a/polyp/main.c +++ b/polyp/main.c @@ -258,8 +258,12 @@ int main(int argc, char *argv[]) { if (conf->auto_log_target) pa_log_set_target(PA_LOG_SYSLOG, NULL); +#ifdef HAVE_SETSID setsid(); +#endif +#ifdef HAVE_SETPGID setpgid(0,0); +#endif close(0); close(1); -- 2.7.4