From 7696bd200e6062f6c15b7922ebfbfc81fcbcb18c Mon Sep 17 00:00:00 2001 From: Alfredo Esteban Date: Sat, 7 Jul 2012 03:15:15 +0200 Subject: [PATCH] pgrep/pkill -F expects \n (Debian Bug report #676709) Hi, I'm sending the patch to fix Debian bug report #676709: pgrep/pkill -F expects "\n". If not present, no process is found/killed: > wc -l /run/atd.pid 1 /run/atd.pid > pgrep -F /run/atd.pid 1213 > wc -l /run/NetworkManager.pid 0 /run/NetworkManager.pid > pgrep -F /run/NetworkManager.pid Alfredo --- pgrep.c | 1 - 1 file changed, 1 deletion(-) diff --git a/pgrep.c b/pgrep.c index 3a4b3451..84f955f9 100644 --- a/pgrep.c +++ b/pgrep.c @@ -241,7 +241,6 @@ static struct el *read_pidfile(void) n = read(fd,buf+1,sizeof buf-2); if (n<1) goto out; - buf[n] = '\0'; pid = strtoul(buf+1,&endp,10); if(endp<=buf+1 || pid<1 || pid>0x7fffffff) goto out;