diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2011-01-06 12:15:03 +1030 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2011-01-06 12:15:03 +1030 |
commit | 6835b78d7de1644607ad28b39286dc3090b51fe3 (patch) | |
tree | a238b27c1af1f40bd853de2ec968e9cd94f47626 | |
parent | 58f929a3cf0a2e17d75baa0f754ef9969a18be3e (diff) |
daemonize: make valgrind happy.
-rw-r--r-- | ccan/daemonize/test/run.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ccan/daemonize/test/run.c b/ccan/daemonize/test/run.c index a471268d..c86f214b 100644 --- a/ccan/daemonize/test/run.c +++ b/ccan/daemonize/test/run.c @@ -5,6 +5,7 @@ #include <unistd.h> #include <err.h> #include <errno.h> +#include <string.h> struct child_data { pid_t pid; @@ -34,6 +35,8 @@ int main(int argc, char *argv[]) char buffer[2]; pid = getpid(); daemonize(); + /* Keep valgrind happy about uninitialized bytes. */ + memset(&daemonized, 0, sizeof(daemonized)); daemonized.pid = getpid(); daemonized.in_root_dir = (getcwd(buffer, 2) != NULL); daemonized.read_from_stdin |