use -1 not 0xffffffff in SIVALS() macros
authorAndrew Tridgell <tridge@samba.org>
Sat, 29 Nov 1997 13:29:13 +0000 (13:29 +0000)
committerAndrew Tridgell <tridge@samba.org>
Sat, 29 Nov 1997 13:29:13 +0000 (13:29 +0000)
use the same process_exists() code on all systems (it's probably
faster anyway)
(This used to be commit 901b95aa77ac1ecc45823c23fb4e1d9da8dc8318)

source3/lib/util.c
source3/smbd/ipc.c

index ac9c701b70dc30ce007e8ecc92297545222fe2fc..2457dec14dd6659d213d1ee3072828f174c8a001 100644 (file)
@@ -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);
 }
 
 
index c862ff3b3895e842d0c039280961f04cf703ed9d..50ad831eb305bdd1d29f9f65a5289b0cdba1d38d 100644 (file)
@@ -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 */