diff options
| author | Colin Percival <cperciva@FreeBSD.org> | 2004-01-22 20:56:06 +0000 |
|---|---|---|
| committer | Colin Percival <cperciva@FreeBSD.org> | 2004-01-22 20:56:06 +0000 |
| commit | b4e148e9ff342a2fa45e18a8bf2b6d39fcf4cbef (patch) | |
| tree | 47138ccc1f23c388e74cd6e478c864a44ed590d0 /usr.bin/killall | |
| parent | 7338182f910eaf85d1e60170c65a5da17f001f8f (diff) | |
Notes
Diffstat (limited to 'usr.bin/killall')
| -rw-r--r-- | usr.bin/killall/killall.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/usr.bin/killall/killall.c b/usr.bin/killall/killall.c index 3628da8af1ab..6d1596903a58 100644 --- a/usr.bin/killall/killall.c +++ b/usr.bin/killall/killall.c @@ -118,6 +118,7 @@ main(int ac, char **av) int zflag = 0; uid_t uid = 0; dev_t tdev = 0; + pid_t mypid; char thiscmd[MAXCOMLEN + 1]; pid_t thispid; uid_t thisuid; @@ -303,6 +304,7 @@ main(int ac, char **av) nprocs = size / sizeof(struct kinfo_proc); if (dflag) printf("nprocs %d\n", nprocs); + mypid = getpid(); for (i = 0; i < nprocs; i++) { if ((procs[i].ki_stat & SZOMB) == SZOMB && !zflag) @@ -313,6 +315,8 @@ main(int ac, char **av) thistdev = procs[i].ki_tdev; thisuid = procs[i].ki_ruid; /* real uid */ + if (thispid == mypid) + continue; matched = 1; if (user) { if (thisuid != uid) |
