diff options
author | Andrew Tridgell <tridge@samba.org> | 1997-11-29 13:29:13 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1997-11-29 13:29:13 +0000 |
commit | 901b95aa77ac1ecc45823c23fb4e1d9da8dc8318 (patch) | |
tree | eee09317a32bef912653aeae344018dc24b0719b | |
parent | e360c79c9cec681c4609783019749773d3e79386 (diff) | |
download | samba-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)
-rw-r--r-- | source/lib/util.c | 24 | ||||
-rw-r--r-- | source/smbd/ipc.c | 8 |
2 files changed, 5 insertions, 27 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); } diff --git a/source/smbd/ipc.c b/source/smbd/ipc.c index c862ff3b389..50ad831eb30 100644 --- a/source/smbd/ipc.c +++ b/source/smbd/ipc.c @@ -2189,7 +2189,7 @@ static BOOL api_RNetUserGetInfo(int cnum,uint16 vuid, char *param,char *data, { SSVAL(p,usri11_priv,Connections[cnum].admin_user?USER_PRIV_ADMIN:USER_PRIV_USER); SIVAL(p,usri11_auth_flags,AF_OP_PRINT); /* auth flags */ - SIVALS(p,usri11_password_age,0xffffffff); /* password age */ + SIVALS(p,usri11_password_age,-1); /* password age */ SIVAL(p,usri11_homedir,PTR_DIFF(p2,p)); /* home dir */ strcpy(p2, lp_logon_path()); p2 = skip_string(p2,1); @@ -2198,8 +2198,8 @@ static BOOL api_RNetUserGetInfo(int cnum,uint16 vuid, char *param,char *data, p2 = skip_string(p2,1); SIVAL(p,usri11_last_logon,0); /* last logon */ SIVAL(p,usri11_last_logoff,0); /* last logoff */ - SSVALS(p,usri11_bad_pw_count,0xffffffff); /* bad pw counts */ - SSVALS(p,usri11_num_logons,0xffffffff); /* num logons */ + SSVALS(p,usri11_bad_pw_count,-1); /* bad pw counts */ + SSVALS(p,usri11_num_logons,-1); /* num logons */ SIVAL(p,usri11_logon_server,PTR_DIFF(p2,p)); /* logon server */ strcpy(p2,"\\\\*"); p2 = skip_string(p2,1); @@ -2209,7 +2209,7 @@ static BOOL api_RNetUserGetInfo(int cnum,uint16 vuid, char *param,char *data, strcpy(p2,""); p2 = skip_string(p2,1); - SIVALS(p,usri11_max_storage,0xffffffff); /* max storage */ + SIVALS(p,usri11_max_storage,-1); /* max storage */ SSVAL(p,usri11_units_per_week,168); /* units per week */ SIVAL(p,usri11_logon_hours,PTR_DIFF(p2,p)); /* logon hours */ |