--- zap.c.orig	Sat Dec 20 11:08:09 1997
+++ zap.c	Fri Oct  2 14:50:18 1998
@@ -2,18 +2,22 @@
 
 #include <stdio.h>
 #include <signal.h>
+
 char	*progname;	/* program name for error message */
-char	*ps = "ps -ag";	/* system dependent */
+char	*ps = "ps -ax";	/* system dependent */
+int		progpid;
+
+FILE *efopen(char *file, char *mode);
 
-main(argc, argv)
-	int argc;
-	char *argv[];
+main(int argc, char **argv)
 {
 	FILE *fin, *popen();
 	char buf[BUFSIZ];
 	int pid;
 
 	progname = argv[0];
+	progpid  = getpid();
+
 	if ((fin = popen(ps, "r")) == NULL) {
 		fprintf(stderr, "%s: can't run %s\n", progname, ps);
 		exit(1);
@@ -21,12 +25,14 @@
 	fgets(buf, sizeof buf, fin);	/* get header line */
 	fprintf(stderr, "%s", buf);
 	while (fgets(buf, sizeof buf, fin) != NULL)
-		if (argc == 1 || strindex(buf, argv[1]) >= 0) {
+		if (argc == 1 || 
+			(strindex(buf, argv[1]) >= 0 && atoi(buf) != progpid)) {
 			buf[strlen(buf)-1] = '\0'; /* suppress \n */
 			fprintf(stderr, "%s? ", buf);
 			if (ttyin() == 'y') {
 				sscanf(buf, "%d", &pid);
-				kill(pid, SIGKILL);
+				if (kill(pid, SIGKILL)<0)
+					perror(buf);
 			}
 		}
 	exit(0);
