summaryrefslogtreecommitdiff
path: root/usr.sbin/cron
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-04-12 17:50:18 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-04-12 17:50:18 +0000
commit47eaece550c09beae070603be304c6f7074ec323 (patch)
treeed6e57268662d3e2a5c3c9034f8180365730f381 /usr.sbin/cron
parent46000ad1d2ad2d7d099402459dbe1db5b0c2772c (diff)
waitpid() can return -1 -- give a useful error message if it does.
Diffstat (limited to 'usr.sbin/cron')
-rw-r--r--usr.sbin/cron/crontab.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/cron/crontab.c b/usr.sbin/cron/crontab.c
index 10c946bcb7e..901b43902f9 100644
--- a/usr.sbin/cron/crontab.c
+++ b/usr.sbin/cron/crontab.c
@@ -16,7 +16,7 @@
*/
#if !defined(lint) && !defined(LINT)
-static char rcsid[] = "$Id: crontab.c,v 1.10 1997/04/12 14:51:22 deraadt Exp $";
+static char rcsid[] = "$Id: crontab.c,v 1.11 1997/04/12 17:50:17 millert Exp $";
#endif
/* crontab - install and manage per-user crontab files
@@ -430,7 +430,10 @@ edit_cmd() {
/* parent */
while (1) {
xpid = waitpid(pid, &waiter, WUNTRACED);
- if (xpid != pid) {
+ if (xpid == -1) {
+ fprintf(stderr, "%s: waitpid() failed waiting for PID %d from \"%s\": %s\n",
+ ProgramName, pid, editor, strerror(errno));
+ } else if (xpid != pid) {
fprintf(stderr, "%s: wrong PID (%d != %d) from \"%s\"\n",
ProgramName, xpid, pid, editor);
goto fatal;