X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Ftest-timeval.c;h=533f81aed3ff87e7e236628cb237d9ff800df591;hb=169e3808f7c510a048589d8e658336919079a6a0;hp=7aa6867a8797ca48b33e928e92eccb00b12b5496;hpb=4a8535f39d5c4f6f34534ea1dcf9f35cddbde0c7;p=openvswitch diff --git a/tests/test-timeval.c b/tests/test-timeval.c index 7aa6867a..533f81ae 100644 --- a/tests/test-timeval.c +++ b/tests/test-timeval.c @@ -20,10 +20,12 @@ #include #include +#include #include #include #include +#include "command-line.h" #include "daemon.h" #include "util.h" @@ -83,6 +85,7 @@ usage(void) int main(int argc, char *argv[]) { + proctitle_init(argc, argv); set_program_name(argv[0]); time_init(); @@ -93,7 +96,7 @@ main(int argc, char *argv[]) } else if (!strcmp(argv[1], "daemon")) { /* Test that time still advances even in a daemon. This is an * interesting test because fork() cancels the interval timer. */ - char cwd[1024]; + char cwd[1024], *pidfile; FILE *success; assert(getcwd(cwd, sizeof cwd) == cwd); @@ -102,7 +105,9 @@ main(int argc, char *argv[]) /* Daemonize, with a pidfile in the current directory. */ set_detach(); - set_pidfile(xasprintf("%s/test-timeval.pid", cwd)); + pidfile = xasprintf("%s/test-timeval.pid", cwd); + set_pidfile(pidfile); + free(pidfile); set_no_chdir(); daemonize();