summaryrefslogtreecommitdiff
path: root/utility.c
diff options
context:
space:
mode:
authorErik Andersen2000-04-18 18:38:29 +0000
committerErik Andersen2000-04-18 18:38:29 +0000
commit229dd2b905e55ab486f5c77334453fdc61cda31b (patch)
tree86f772115e351353772f7e7ef3917229a98b7d84 /utility.c
parent5d68857b9cc6f454046dd1397af93890fd298d8e (diff)
downloadbusybox-229dd2b905e55ab486f5c77334453fdc61cda31b.zip
busybox-229dd2b905e55ab486f5c77334453fdc61cda31b.tar.gz
Fix killall
-Erik
Diffstat (limited to 'utility.c')
-rw-r--r--utility.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/utility.c b/utility.c
index 571d1f5..b844c3b 100644
--- a/utility.c
+++ b/utility.c
@@ -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");