From 9c5e26a56aaaf1143b43e61d208ddaeb96f2ffcb Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 1 Apr 2006 05:41:34 +0000 Subject: [PATCH] r14847: Tell static checkers that exit_server() doesn't return. Jeremy. --- source/include/includes.h | 1 + source/smbd/server.c | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/source/include/includes.h b/source/include/includes.h index e02a981d56a..620af59db70 100644 --- a/source/include/includes.h +++ b/source/include/includes.h @@ -1562,4 +1562,5 @@ LDAP *ldap_open_with_timeout(const char *server, int port, unsigned int to); #endif void smb_panic( const char *why ) NORETURN_ATTRIBUTE ; +void exit_server(const char *reason) NORETURN_ATTRIBUTE ; #endif /* _INCLUDES_H */ diff --git a/source/smbd/server.c b/source/smbd/server.c index 5da73046a12..4d737d28498 100644 --- a/source/smbd/server.c +++ b/source/smbd/server.c @@ -570,10 +570,14 @@ BOOL reload_services(BOOL test) #if DUMP_CORE + +static void dump_core(void) NORETURN_ATTRIBUTE ; + /******************************************************************* prepare to dump a core file - carefully! ********************************************************************/ -static BOOL dump_core(void) + +static void dump_core(void) { char *p; pstring dname; @@ -584,7 +588,9 @@ static BOOL dump_core(void) mkdir(dname,0700); sys_chown(dname,getuid(),getgid()); chmod(dname,0700); - if (chdir(dname)) return(False); + if (chdir(dname)) { + abort(); + } umask(~(0700)); #ifdef HAVE_GETRLIMIT @@ -608,7 +614,6 @@ static BOOL dump_core(void) CatchSignal(SIGABRT,SIGNAL_CAST SIG_DFL); #endif abort(); - return(True); } #endif @@ -616,7 +621,7 @@ static BOOL dump_core(void) Exit the server. ****************************************************************************/ -void exit_server(const char *reason) + void exit_server(const char *reason) { static int firsttime=1; @@ -659,7 +664,7 @@ void exit_server(const char *reason) DEBUGLEVEL = oldlevel; DEBUG(0,("===============================================================\n")); #if DUMP_CORE - if (dump_core()) return; + dump_core(); #endif }