aboutsummaryrefslogtreecommitdiffhomepage
path: root/proc.c
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2009-02-23 06:28:52 +1000
committerGravatar axel <axel@liljencrantz.se>2009-02-23 06:28:52 +1000
commit14c84ffbcbbe0368e61b7bc59d44a1d7bc906d33 (patch)
treea0fbafe2d63e86d5adcd615a7bc70fade00f0803 /proc.c
parentf71c6f3f0e34c034c3dec54289527a68a136749f (diff)
Check return value of a few write calls and retry on EINTR, and fix a few other warnings, mostly by printing error messages before giving up.
darcs-hash:20090222202852-ac50b-b0e79142af5b7a99e55271d4001fa252d9684a1d.gz
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/proc.c b/proc.c
index 0b9c4bae..35dff1d4 100644
--- a/proc.c
+++ b/proc.c
@@ -356,6 +356,8 @@ static void mark_process_status( job_t *j,
}
else
{
+ ssize_t ignore;
+
/* This should never be reached */
p->completed = 1;
@@ -364,8 +366,12 @@ static void mark_process_status( job_t *j,
MESS_SIZE,
"Process %d exited abnormally\n",
(int) p->pid );
-
- write( 2, mess, strlen(mess) );
+ /*
+ If write fails, do nothing. We're in a signal handlers error
+ handler. If things aren't working properly, it's safer to
+ give up.
+ */
+ ignore = write( 2, mess, strlen(mess) );
}
}