svn commit: samba r15022 - in branches/SAMBA_3_0/source: include smbd

jra at samba.org jra at samba.org
Mon Apr 10 22:47:10 GMT 2006


Author: jra
Date: 2006-04-10 22:47:09 +0000 (Mon, 10 Apr 2006)
New Revision: 15022

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=15022

Log:
Fix core dumps on normal server exit.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/include/includes.h
   branches/SAMBA_3_0/source/smbd/process.c
   branches/SAMBA_3_0/source/smbd/server.c


Changeset:
Modified: branches/SAMBA_3_0/source/include/includes.h
===================================================================
--- branches/SAMBA_3_0/source/include/includes.h	2006-04-10 22:03:26 UTC (rev 15021)
+++ branches/SAMBA_3_0/source/include/includes.h	2006-04-10 22:47:09 UTC (rev 15022)
@@ -1564,7 +1564,7 @@
 void smb_panic( const char *why ) NORETURN_ATTRIBUTE ;
 void dump_core(void) NORETURN_ATTRIBUTE ;
 void exit_server(const char *const reason) NORETURN_ATTRIBUTE ;
-void exit_server_cleanly(void) NORETURN_ATTRIBUTE ;
+void exit_server_cleanly(const char *const reason) NORETURN_ATTRIBUTE ;
 void exit_server_fault(void) NORETURN_ATTRIBUTE ;
 
 #endif /* _INCLUDES_H */

Modified: branches/SAMBA_3_0/source/smbd/process.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/process.c	2006-04-10 22:03:26 UTC (rev 15021)
+++ branches/SAMBA_3_0/source/smbd/process.c	2006-04-10 22:47:09 UTC (rev 15022)
@@ -303,7 +303,7 @@
 	process_aio_queue();
 
 	if (got_sig_term) {
-		exit_server_cleanly();
+		exit_server_cleanly("termination signal");
 	}
 
 	/* check for async change notify events */
@@ -886,7 +886,7 @@
 	/* Make sure this is an SMB packet. smb_size contains NetBIOS header so subtract 4 from it. */
 	if ((strncmp(smb_base(inbuf),"\377SMB",4) != 0) || (size < (smb_size - 4))) {
 		DEBUG(2,("Non-SMB packet of length %d. Terminating server\n",smb_len(inbuf)));
-		exit_server("Non-SMB packet");
+		exit_server_cleanly("Non-SMB packet");
 		return(-1);
 	}
 
@@ -1100,7 +1100,7 @@
 			static unsigned char buf[5] = {0x83, 0, 0, 1, 0x81};
 			DEBUG( 1, ( "Connection denied from %s\n", client_addr() ) );
 			(void)send_smb(smbd_server_fd(),(char *)buf);
-			exit_server("connection denied");
+			exit_server_cleanly("connection denied");
 		}
 	}
 
@@ -1122,7 +1122,7 @@
 			DEBUG(0,("ERROR: Invalid message response size! %d %d\n",
 				nread, smb_len(outbuf)));
 		} else if (!send_smb(smbd_server_fd(),outbuf)) {
-			exit_server("process_smb: send_smb failed.");
+			exit_server_cleanly("process_smb: send_smb failed.");
 		}
 	}
 	trans_num++;

Modified: branches/SAMBA_3_0/source/smbd/server.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/server.c	2006-04-10 22:03:26 UTC (rev 15021)
+++ branches/SAMBA_3_0/source/smbd/server.c	2006-04-10 22:47:09 UTC (rev 15022)
@@ -153,7 +153,7 @@
 			    void *buf, size_t len)
 {
 	DEBUG(3, ("got a SHUTDOWN message\n"));
-	exit_server_cleanly();
+	exit_server_cleanly(NULL);
 }
 
 #ifdef DEVELOPER
@@ -397,7 +397,7 @@
 		
 		if (num == -1 && errno == EINTR) {
 			if (got_sig_term) {
-				exit_server_cleanly();
+				exit_server_cleanly(NULL);
 			}
 
 			/* check for sighup processing */
@@ -681,9 +681,9 @@
 	exit_server_common(SERVER_EXIT_ABNORMAL, explanation);
 }
 
-void exit_server_cleanly(void)
+void exit_server_cleanly(const char *const explanation)
 {
-	exit_server_common(SERVER_EXIT_NORMAL, NULL);
+	exit_server_common(SERVER_EXIT_NORMAL, explanation);
 }
 
 void exit_server_fault(void)
@@ -1014,6 +1014,6 @@
 
 	namecache_shutdown();
 
-	exit_server_cleanly();
+	exit_server_cleanly(NULL);
 	return(0);
 }



More information about the samba-cvs mailing list