about summary refs log tree commit diff
path: root/pwait.c
diff options
context:
space:
mode:
Diffstat (limited to 'pwait.c')
-rw-r--r--pwait.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/pwait.c b/pwait.c
index e5f6fde..d32589d 100644
--- a/pwait.c
+++ b/pwait.c
@@ -184,6 +184,13 @@ usage:
 			fprintf(stderr, "%s: invalid process id\n", argv[n]);
 			continue;
 		}
+		errno = 0;
+		kill(pid, 0);
+		if (errno == ESRCH) {
+			fprintf(stderr, "%s: no such process\n", argv[n]);
+			continue;
+		}
+
 		pids[m++] = pid;
 	}