summaryrefslogtreecommitdiffstats
path: root/src/dfork.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2004-12-18 22:22:54 +0000
committerLennart Poettering <lennart@poettering.net>2004-12-18 22:22:54 +0000
commitc73f5e4e6922363cc7cbf4f39f236e310845f9b9 (patch)
tree22711d070b1bf3e473b2a41ba1ee5dbba2772923 /src/dfork.c
parentfeb9b77fc7a598f756734b3224a5acd4b5463f7d (diff)
* build system update
* doxygen update * add some SVN tags to some files * gcc 2.95 compatiblity * remove some compilation warnings * fix testd git-svn-id: file:///home/lennart/svn/public/libdaemon/trunk@69 153bfa13-eec0-0310-be40-b0cb6a0e1b4b
Diffstat (limited to 'src/dfork.c')
-rw-r--r--src/dfork.c12
1 files changed, 8 insertions, 4 deletions
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);