From c73f5e4e6922363cc7cbf4f39f236e310845f9b9 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 18 Dec 2004 22:22:54 +0000 Subject: * 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 --- src/dfork.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/dfork.c') 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); -- cgit