]> git.ozlabs.org Git - ccan/blobdiff - tools/tools.c
rfc822: Update rfc822 module to use testdepends
[ccan] / tools / tools.c
index 1eddf7e934ab9f658cadb9fe4e7a2c34b8312b15..5b6581e5fc068c69218c4823672fef13a286c58e 100644 (file)
@@ -73,7 +73,7 @@ char *run_with_timeout(const void *ctx, const char *cmd,
        int p[2];
        char *ret;
        int status, ms;
-       struct timeval start;
+       struct timespec start;
 
        *ok = false;
        if (pipe(p) != 0)
@@ -106,7 +106,7 @@ char *run_with_timeout(const void *ctx, const char *cmd,
 
                signal(SIGALRM, killme);
                itim.it_interval.tv_sec = itim.it_interval.tv_usec = 0;
-               itim.it_value = time_from_msec(*timeout_ms);
+               itim.it_value = timespec_to_timeval(time_from_msec(*timeout_ms));
                setitimer(ITIMER_REAL, &itim, NULL);
 
                status = system(cmd);