diff options
author | Erik Andersen <andersen@codepoet.org> | 2000-04-18 18:38:29 +0000 |
---|---|---|
committer | Erik Andersen <andersen@codepoet.org> | 2000-04-18 18:38:29 +0000 |
commit | 229dd2b905e55ab486f5c77334453fdc61cda31b (patch) | |
tree | 86f772115e351353772f7e7ef3917229a98b7d84 | |
parent | 5d68857b9cc6f454046dd1397af93890fd298d8e (diff) |
Fix killall
-Erik
-rw-r--r-- | utility.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1343,6 +1343,7 @@ extern pid_t* findPidByName( char* pidName) FILE *status; char filename[256]; char buffer[256]; + char* p; /* If it isn't a number, we don't want it */ if (!isdigit(*next->d_name)) @@ -1357,7 +1358,8 @@ extern pid_t* findPidByName( char* pidName) fgets(buffer, 256, status); fclose(status); - if ((strstr(buffer, pidName) != NULL)) { + if (((p=strstr(buffer, pidName)) != NULL) + && (strncmp(p, pidName, strlen(pidName)) != 0)) { pidList=realloc( pidList, sizeof(pid_t) * (i+2)); if (pidList==NULL) fatalError("out of memory\n"); |