summaryrefslogtreecommitdiff
path: root/source3/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
commitec8e33cde691a6591bcd9846308ba7e6bd1cd882 (patch)
tree3ac523615a47032e3fb22a3038163da025d86a53 /source3/lib
parentcf9d07cc7d41627a59ea3bec5ba2b9eebb894ab5 (diff)
downloadsamba-ec8e33cde691a6591bcd9846308ba7e6bd1cd882.tar.gz
samba-ec8e33cde691a6591bcd9846308ba7e6bd1cd882.tar.bz2
samba-ec8e33cde691a6591bcd9846308ba7e6bd1cd882.zip
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)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util.c24
1 files changed, 1 insertions, 23 deletions
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);
}