diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2017-07-17 18:40:06 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2017-07-17 18:42:03 +0300 |
commit | 6efb45e5ff89896727a0946218b3d5efb08aac1e (patch) | |
tree | 61075cf96cf15e46c3f7476ea757c12b4599838e /runcap.c | |
parent | db60fd0122ec26a7ff354c395590abf919274181 (diff) | |
download | runcap-6efb45e5ff89896727a0946218b3d5efb08aac1e.tar.gz runcap-6efb45e5ff89896727a0946218b3d5efb08aac1e.tar.bz2 |
Write a test tool
* runcap.c (timeval_after): Fix typo.
* t/rt.c: New file.
Diffstat (limited to 'runcap.c')
-rw-r--r-- | runcap.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -194,7 +194,7 @@ timeval_after(struct timeval const *a, struct timeval const *b) if (a->tv_sec == b->tv_sec) return a->tv_usec < b->tv_usec; else - return a->tv_sec < b->tv_usec; + return a->tv_sec < b->tv_sec; } static inline struct timeval @@ -343,6 +343,8 @@ runcap_loop(struct runcap *rc) gettimeofday(&now, NULL); tv = timeval_diff(&finish, &now); if (!timeval_after(&now, &finish)) { + if (rc->rc_pid == (time_t) -1) + break; kill(rc->rc_pid, SIGKILL); continue; } |