aboutsummaryrefslogtreecommitdiff
path: root/runcap.c
diff options
context:
space:
mode:
Diffstat (limited to 'runcap.c')
-rw-r--r--runcap.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/runcap.c b/runcap.c
index 26654f8..6790dc4 100644
--- a/runcap.c
+++ b/runcap.c
@@ -137,8 +137,11 @@ stream_capture_get(struct stream_capture *cap, int *feof)
}
rc = read(cap->sc_fd, cap->sc_base + cap->sc_level, cap->sc_size - cap->sc_level);
- if (rc == -1)
+ if (rc == -1) {
+ if (errno == EINTR)
+ return 0;
return -1;
+ }
if (rc == 0) {
*feof = 1;
return 0;
@@ -170,8 +173,11 @@ stream_capture_put(struct stream_capture *cap, int *feof)
{
if (cap->sc_cur < cap->sc_level) {
int n = write(cap->sc_fd, &cap->sc_base[cap->sc_cur], 1);
- if (n == -1)
+ if (n == -1) {
+ if (errno == EINTR)
+ return 0;
return -1;
+ }
if (n == 0) {
errno = ENOSPC;
return -1;
@@ -329,6 +335,8 @@ runcap_loop(struct runcap *rc)
flags = 0;
pid = waitpid(rc->rc_pid, &rc->rc_status, flags);
if (pid == -1) {
+ if (errno == EINTR)
+ continue;
rc->rc_errno = errno;
kill(rc->rc_pid, SIGKILL);
break;

Return to:

Send suggestions and report system problems to the System administrator.