summaryrefslogtreecommitdiffstats
path: root/source/lib
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1997-11-29 13:29:13 +0000
committerAndrew Tridgell <tridge@samba.org>1997-11-29 13:29:13 +0000
commit901b95aa77ac1ecc45823c23fb4e1d9da8dc8318 (patch)
treeeee09317a32bef912653aeae344018dc24b0719b /source/lib
parente360c79c9cec681c4609783019749773d3e79386 (diff)
downloadsamba-901b95aa77ac1ecc45823c23fb4e1d9da8dc8318.tar.gz
samba-901b95aa77ac1ecc45823c23fb4e1d9da8dc8318.tar.xz
samba-901b95aa77ac1ecc45823c23fb4e1d9da8dc8318.zip
use -1 not 0xffffffff in SIVALS() macros
use the same process_exists() code on all systems (it's probably faster anyway)
Diffstat (limited to 'source/lib')
-rw-r--r--source/lib/util.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/source/lib/util.c b/source/lib/util.c
index ac9c701b70d..2457dec14dd 100644
--- a/source/lib/util.c
+++ b/source/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);
}