#include <memblock.h>
#include <limits.h>
#include <fcntl.h>
+#include <sys/ioctl.h>
#ifdef HAVE_LIBWRAP
#include <syslog.h>
if (conf->daemonize) {
pid_t child;
+ int tty_fd;
if (pa_stdio_acquire() < 0) {
pa_log(__FILE__": failed to acquire stdio.\n");
open("/dev/null", O_RDONLY);
open("/dev/null", O_WRONLY);
open("/dev/null", O_WRONLY);
+
+ signal(SIGTTOU, SIG_IGN);
+ signal(SIGTTIN, SIG_IGN);
+ signal(SIGTSTP, SIG_IGN);
+
+ if ((tty_fd = open("/dev/tty", O_RDWR)) >= 0) {
+ ioctl(tty_fd, TIOCNOTTY, (char*) 0);
+ close(tty_fd);
+ }
}
chdir("/");