From ec8e33cde691a6591bcd9846308ba7e6bd1cd882 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 29 Nov 1997 13:29:13 +0000 Subject: use -1 not 0xffffffff in SIVALS() macros use the same process_exists() code on all systems (it's probably faster anyway) (This used to be commit 901b95aa77ac1ecc45823c23fb4e1d9da8dc8318) --- source3/lib/util.c | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'source3/lib') diff --git a/source3/lib/util.c b/source3/lib/util.c index ac9c701b70..2457dec14d 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -3779,29 +3779,7 @@ check if a process exists. Does this work on all unixes? ****************************************************************************/ BOOL process_exists(int pid) { -#ifdef LINUX - fstring s; - sprintf(s,"/proc/%d",pid); - return(directory_exist(s,NULL)); -#else - { - static BOOL tested=False; - static BOOL ok=False; - fstring s; - if (!tested) { - tested = True; - sprintf(s,"/proc/%05d",(int)getpid()); - ok = file_exist(s,NULL); - } - if (ok) { - sprintf(s,"/proc/%05d",pid); - return(file_exist(s,NULL)); - } - } - - /* CGH 8/16/96 - added ESRCH test */ - return(pid == getpid() || kill(pid,0) == 0 || errno != ESRCH); -#endif + return(kill(pid,0) == 0 || errno != ESRCH); } -- cgit