Fixed up atomic update code.
authorJeremy Allison <jra@samba.org>
Wed, 9 Jan 2002 02:35:08 +0000 (02:35 +0000)
committerJeremy Allison <jra@samba.org>
Wed, 9 Jan 2002 02:35:08 +0000 (02:35 +0000)
Jeremy.
(This used to be commit 274b04d4a6123fbfe363afc214e908ab36c7e8a7)

source3/passdb/secrets.c
source3/smbd/process.c
source3/smbd/server.c

index fd616c684142875f613f2c6aa60e91ee0a3b94d0..a8c942bb8c2b6a6622ab7f627d526f14d2dd9c4f 100644 (file)
@@ -234,7 +234,7 @@ void reset_globals_after_fork(void)
 
        if (tdb) {
                uint32 initial_val = sys_getpid();
-               tdb_change_int_atomic(tdb, "INFO/random_seed", (int *)&initial_val, 1);
+               tdb_change_int32_atomic(tdb, "INFO/random_seed", (int *)&initial_val, 1);
                set_rand_reseed_data((unsigned char *)&initial_val, sizeof(initial_val));
        }
 
index 2b31a24ceda6a829799552b68107d63fbcbbaf4f..ff53acbd9eee803e148211b7221f7724ad1becd7 100644 (file)
@@ -791,7 +791,7 @@ static int construct_reply(char *inbuf,char *outbuf,int size,int bufsize)
 ****************************************************************************/
 static BOOL smbd_process_limit(void)
 {
-       int  total_smbds;
+       int32  total_smbds;
        
        if (lp_max_smbd_processes()) {
 
@@ -807,7 +807,7 @@ set. Ignoring max smbd restriction.\n"));
                        return False;
                }
 
-               if (tdb_change_int_atomic(conn_tdb_ctx(), "INFO/total_smbds", &total_smbds, 1) == -1)
+               if (tdb_change_int32_atomic(conn_tdb_ctx(), "INFO/total_smbds", &total_smbds, 1) == -1)
                        return True;
 
                return total_smbds > lp_max_smbd_processes();
index 1fab45048dc53540c39eed5f6173935339c636b1..08bcf22dd293392498bceb3a6cbba99b0d098214 100644 (file)
@@ -460,11 +460,11 @@ update the current smbd process count
 
 static void decrement_smbd_process_count(void)
 {
-       int total_smbds;
+       int32 total_smbds;
 
        if (lp_max_smbd_processes()) {
                total_smbds = 0;
-               tdb_change_int_atomic(conn_tdb_ctx(), "INFO/total_smbds", &total_smbds, -1);
+               tdb_change_int32_atomic(conn_tdb_ctx(), "INFO/total_smbds", &total_smbds, -1);
        }
 }