summaryrefslogtreecommitdiff
path: root/sysutils/scanbuttond/files/patch-scanbuttond.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysutils/scanbuttond/files/patch-scanbuttond.c')
-rw-r--r--sysutils/scanbuttond/files/patch-scanbuttond.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/sysutils/scanbuttond/files/patch-scanbuttond.c b/sysutils/scanbuttond/files/patch-scanbuttond.c
new file mode 100644
index 000000000000..a405affbb82a
--- /dev/null
+++ b/sysutils/scanbuttond/files/patch-scanbuttond.c
@@ -0,0 +1,35 @@
+--- scanbuttond.c.orig Fri Feb 17 00:23:53 2006
++++ scanbuttond.c Thu Apr 6 00:52:29 2006
+@@ -223,8 +223,15 @@
+ exit(EXIT_FAILURE);
+ }
+
++ openlog(NULL, 0, LOG_DAEMON);
++
+ // daemonize
+ if (daemonize) {
++ if (daemon(0, 0) != 0) {
++ syslog(LOG_ERR, "daemon() failed.");
++ }
++ }
++/*
+ pid = fork();
+ if (pid < 0) {
+ printf("Can't fork!\n");
+@@ -259,6 +266,7 @@
+ close(STDOUT_FILENO);
+ close(STDERR_FILENO);
+ }
++*/
+
+ // setup the environment
+ char* oldpath = getenv("PATH");
+@@ -292,7 +300,7 @@
+ signal(SIGHUP, &sighandler);
+ signal(SIGINT, &sighandler);
+ signal(SIGSEGV, &sighandler);
+- signal(SIGCLD, SIG_IGN);
++ signal(SIGCHLD, SIG_IGN);
+
+ syslog(LOG_INFO, "scanbuttond started");
+