summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>1997-04-12 17:50:17 +0000
committermillert <millert@openbsd.org>1997-04-12 17:50:17 +0000
commit1b21650e40e710faf841bf150ab2f99255bd050e (patch)
treea04819a48e5deea6b458ffc74af2ad3a546d13b3
parentdon't print more directory slashes than user specified on error. (diff)
downloadwireguard-openbsd-1b21650e40e710faf841bf150ab2f99255bd050e.tar.xz
wireguard-openbsd-1b21650e40e710faf841bf150ab2f99255bd050e.zip
waitpid() can return -1 -- give a useful error message if it does.
-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;