diff options
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; } |