aboutsummaryrefslogtreecommitdiff
path: root/runcap.c
diff options
context:
space:
mode:
Diffstat (limited to 'runcap.c')
-rw-r--r--runcap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/runcap.c b/runcap.c
index 648fd84..9dcefa1 100644
--- a/runcap.c
+++ b/runcap.c
@@ -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;
}

Return to:

Send suggestions and report system problems to the System administrator.