summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am27
-rw-r--r--src/dfork.c12
-rw-r--r--src/dfork.h2
-rw-r--r--src/dlog.c2
-rw-r--r--src/dlog.h2
-rw-r--r--src/dnonblock.c2
-rw-r--r--src/dnonblock.h2
-rw-r--r--src/dpid.c2
-rw-r--r--src/dpid.h2
-rw-r--r--src/dsignal.c2
-rw-r--r--src/dsignal.h5
11 files changed, 46 insertions, 14 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index a4bebbd..c14000c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -18,16 +18,25 @@
AM_CFLAGS=-D_GNU_SOURCE
-pkginclude_HEADERS = dlog.h dfork.h dsignal.h dnonblock.h dpid.h dexec.h daemon.h
+pkginclude_HEADERS = \
+ dlog.h \
+ dfork.h \
+ dsignal.h \
+ dnonblock.h \
+ dpid.h \
+ dexec.h \
+ daemon.h
lib_LTLIBRARIES = libdaemon.la
libdaemon_la_SOURCES = \
- dlog.c dlog.h \
- dfork.c dfork.h \
- dsignal.c dsignal.h \
- dnonblock.c dnonblock.h \
- dpid.c dpid.h \
- dexec.c dexec.h \
- daemon.h
-libdaemon_la_LDFLAGS = -version-info 2:0:2
+ dlog.c \
+ dfork.c \
+ dsignal.c \
+ dnonblock.c \
+ dpid.c \
+ dexec.c \
+ daemon.h \
+ $(pkg_include_HEADERS)
+
+libdaemon_la_LDFLAGS = -version-info 2:1:2
diff --git a/src/dfork.c b/src/dfork.c
index b795dc6..2fa9f30 100644
--- a/src/dfork.c
+++ b/src/dfork.c
@@ -73,7 +73,7 @@ static ssize_t atomic_read(int fd, void *d, size_t l) {
}
t += r;
- d += r;
+ d = (char*) d + r;
l -= r;
}
@@ -95,7 +95,7 @@ static ssize_t atomic_write(int fd, const void *d, size_t l) {
}
t += r;
- d += r;
+ d = (char*) d + r;
l -= r;
}
@@ -212,7 +212,7 @@ pid_t daemon_fork(void) {
setpgrp();
if ((tty_fd = open("/dev/tty", O_RDWR)) >= 0) {
- ioctl(tty_fd, TIOCNOTTY, (char*) 0);
+ ioctl(tty_fd, TIOCNOTTY, NULL);
close(tty_fd);
}
@@ -300,9 +300,13 @@ int daemon_retval_wait(int timeout) {
int i;
if (timeout > 0) {
- struct timeval tv = { timeout, 0 };
+ struct timeval tv;
int s;
fd_set fds;
+
+ tv.tv_sec = timeout;
+ tv.tv_usec = 0;
+
FD_ZERO(&fds);
FD_SET(_daemon_retval_pipe[0], &fds);
diff --git a/src/dfork.h b/src/dfork.h
index 01b97b4..faac652 100644
--- a/src/dfork.h
+++ b/src/dfork.h
@@ -1,6 +1,8 @@
#ifndef foodaemonforkhfoo
#define foodaemonforkhfoo
+/* $Id$ */
+
/*
* This file is part of libdaemon.
*
diff --git a/src/dlog.c b/src/dlog.c
index 05967e8..1fc3e08 100644
--- a/src/dlog.c
+++ b/src/dlog.c
@@ -1,3 +1,5 @@
+/* $Id$ */
+
/*
* This file is part of libdaemon.
*
diff --git a/src/dlog.h b/src/dlog.h
index 79c217e..0f74dde 100644
--- a/src/dlog.h
+++ b/src/dlog.h
@@ -1,6 +1,8 @@
#ifndef foodaemonloghfoo
#define foodaemonloghfoo
+/* $Id$ */
+
/*
* This file is part of libdaemon.
*
diff --git a/src/dnonblock.c b/src/dnonblock.c
index a5e6073..6c50279 100644
--- a/src/dnonblock.c
+++ b/src/dnonblock.c
@@ -1,3 +1,5 @@
+/* $Id$ */
+
/*
* This file is part of libdaemon.
*
diff --git a/src/dnonblock.h b/src/dnonblock.h
index 6cb362b..16efa25 100644
--- a/src/dnonblock.h
+++ b/src/dnonblock.h
@@ -1,6 +1,8 @@
#ifndef foodaemonnonblockhfoo
#define foodaemonnonblockhfoo
+/* $Id$ */
+
/*
* This file is part of libdaemon.
*
diff --git a/src/dpid.c b/src/dpid.c
index b802b71..e41e37c 100644
--- a/src/dpid.c
+++ b/src/dpid.c
@@ -1,3 +1,5 @@
+/* $Id$ */
+
/*
* This file is part of libdaemon.
*
diff --git a/src/dpid.h b/src/dpid.h
index fa2df8f..cea9613 100644
--- a/src/dpid.h
+++ b/src/dpid.h
@@ -1,6 +1,8 @@
#ifndef foodaemonpidhfoo
#define foodaemonpidhfoo
+/* $Id$ */
+
/*
* This file is part of libdaemon.
*
diff --git a/src/dsignal.c b/src/dsignal.c
index 0eb11a2..2eafc0c 100644
--- a/src/dsignal.c
+++ b/src/dsignal.c
@@ -1,3 +1,5 @@
+/* $Id$ */
+
/*
* This file is part of libdaemon.
*
diff --git a/src/dsignal.h b/src/dsignal.h
index c777bb7..ef3342c 100644
--- a/src/dsignal.h
+++ b/src/dsignal.h
@@ -1,6 +1,9 @@
#ifndef foodaemonsignalhfoo
#define foodaemonsignalhfoo
+/* $Id$ */
+
+
/*
* This file is part of libdaemon.
*
@@ -37,7 +40,7 @@ extern "C" {
*/
/** Installs signal handlers for the specified signals
- * @param s, ... The signals to install handlers for. The list should be terminated by -1
+ * @param s, ... The signals to install handlers for. The list should be terminated by 0
* @return zero on success, nonzero on failure
*/
int daemon_signal_init(int s, ...);