X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fdaemonize%2Ftest%2Frun.c;h=c86f214bcae6e3fcfb2901e436971471e21e2479;hp=a471268d3ef172995fd4a0088cd70c9266c75383;hb=6835b78d7de1644607ad28b39286dc3090b51fe3;hpb=cd13fd53487ba6f10b78ab1ffd625cb3da7ab22a 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 #include #include +#include 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