summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-03-28 15:50:13 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:15:45 -0500
commit80afbe5cf5f30e0f3116f99fc44c930f2cd60935 (patch)
tree8073d3ad196e623279c3809fae7db5369674d021 /source3
parentfe05699b00fd9889d8e6af6d64e12261fbc9a52a (diff)
downloadsamba-80afbe5cf5f30e0f3116f99fc44c930f2cd60935.tar.gz
samba-80afbe5cf5f30e0f3116f99fc44c930f2cd60935.tar.bz2
samba-80afbe5cf5f30e0f3116f99fc44c930f2cd60935.zip
r14751: Use the noreturn attribute to try and tell coverity that
smb_panic can't return. Jeremy. (This used to be commit ba9c98983efbf4871e1ec07df37590d97ec52fba)
Diffstat (limited to 'source3')
-rw-r--r--source3/include/includes.h9
-rw-r--r--source3/lib/util.c21
2 files changed, 21 insertions, 9 deletions
diff --git a/source3/include/includes.h b/source3/include/includes.h
index 9f6f8b2471..e02a981d56 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -1553,4 +1553,13 @@ LDAP *ldap_open_with_timeout(const char *server, int port, unsigned int to);
#define CONST_DISCARD(type, ptr) ((type) ((void *) (ptr)))
#define CONST_ADD(type, ptr) ((type) ((const void *) (ptr)))
+#ifndef NORETURN_ATTRIBUTE
+#if (__GNUC__ >= 3)
+#define NORETURN_ATTRIBUTE __attribute__ ((noreturn))
+#else
+#define NORETURN_ATTRIBUTE
+#endif
+#endif
+
+void smb_panic( const char *why ) NORETURN_ATTRIBUTE ;
#endif /* _INCLUDES_H */
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 5bf9409c2f..0b831ea335 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -1542,14 +1542,6 @@ gid_t nametogid(const char *name)
}
/*******************************************************************
- legacy wrapper for smb_panic2()
-********************************************************************/
-void smb_panic( const char *why )
-{
- smb_panic2( why, True );
-}
-
-/*******************************************************************
Something really nasty happened - panic !
********************************************************************/
@@ -1557,7 +1549,7 @@ void smb_panic( const char *why )
#include <libexc.h>
#endif
-void smb_panic2(const char *why, BOOL decrement_pid_count )
+static void smb_panic2(const char *why, BOOL decrement_pid_count )
{
char *cmd;
int result;
@@ -1664,6 +1656,17 @@ void smb_panic2(const char *why, BOOL decrement_pid_count )
}
/*******************************************************************
+ wrapper for smb_panic2()
+********************************************************************/
+
+ void smb_panic( const char *why )
+{
+ smb_panic2( why, True );
+ /* Notreached. */
+ abort();
+}
+
+/*******************************************************************
A readdir wrapper which just returns the file name.
********************************************************************/