Add UNUSED(paramname) macro to be used in parameter lists, to quieten
[ira/wip.git] / source3 / smbd / server.c
index 403ed12c408039f343ea6f9eab129164cd8ce60b..a8c1bc5c15ea57ac44ab5931e337a47bd2b38be3 100644 (file)
@@ -80,7 +80,8 @@ static void  killkids(void)
   process a sam sync message - not sure whether to do this here or
   somewhere else
 ****************************************************************************/
-static void msg_sam_sync(int msg_type, pid_t pid, void *buf, size_t len)
+static void msg_sam_sync(int UNUSED(msg_type), pid_t UNUSED(pid),
+                        void *UNUSED(buf), size_t UNUSED(len))
 {
         DEBUG(10, ("** sam sync message received, ignoring\n"));
 }
@@ -460,11 +461,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);
        }
 }
 
@@ -475,7 +476,7 @@ void exit_server(char *reason)
 {
        static int firsttime=1;
        extern char *last_inbuf;
-       extern auth_authsupplied_info *negprot_global_auth_info;
+       extern struct auth_context *negprot_global_auth_context;
 
        if (!firsttime)
                exit(0);
@@ -484,7 +485,9 @@ void exit_server(char *reason)
        change_to_root_user();
        DEBUG(2,("Closing connections\n"));
 
-       free_auth_info(&negprot_global_auth_info);
+       if (negprot_global_auth_context) {
+               negprot_global_auth_context->free(&negprot_global_auth_context);
+       }
 
        conn_close_all();
 
@@ -785,6 +788,15 @@ static void usage(char *pname)
                become_daemon();
        }
 
+#if HAVE_SETPGID
+       /*
+        * If we're interactive we want to set our own process group for
+        * signal management.
+        */
+       if (interactive)
+               setpgid( (pid_t)0, (pid_t)0);
+#endif
+
        if (!directory_exist(lp_lockdir(), NULL)) {
                mkdir(lp_lockdir(), 0755);
        }
@@ -796,6 +808,7 @@ static void usage(char *pname)
        if (!message_init()) {
                exit(1);
        }
+       register_msg_pool_usage();
 
        /* Setup the main smbd so that we can get messages. */
        claim_connection(NULL,"",MAXSTATUS,True);