svn commit: samba r14751 - in branches/SAMBA_3_0/source: include lib
jra at samba.org
jra at samba.org
Tue Mar 28 15:50:16 GMT 2006
Author: jra
Date: 2006-03-28 15:50:13 +0000 (Tue, 28 Mar 2006)
New Revision: 14751
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=14751
Log:
Use the noreturn attribute to try and tell coverity that
smb_panic can't return.
Jeremy.
Modified:
branches/SAMBA_3_0/source/include/includes.h
branches/SAMBA_3_0/source/lib/util.c
Changeset:
Modified: branches/SAMBA_3_0/source/include/includes.h
===================================================================
--- branches/SAMBA_3_0/source/include/includes.h 2006-03-28 15:49:57 UTC (rev 14750)
+++ branches/SAMBA_3_0/source/include/includes.h 2006-03-28 15:50:13 UTC (rev 14751)
@@ -1553,4 +1553,13 @@
#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 */
Modified: branches/SAMBA_3_0/source/lib/util.c
===================================================================
--- branches/SAMBA_3_0/source/lib/util.c 2006-03-28 15:49:57 UTC (rev 14750)
+++ branches/SAMBA_3_0/source/lib/util.c 2006-03-28 15:50:13 UTC (rev 14751)
@@ -1542,14 +1542,6 @@
}
/*******************************************************************
- legacy wrapper for smb_panic2()
-********************************************************************/
-void smb_panic( const char *why )
-{
- smb_panic2( why, True );
-}
-
-/*******************************************************************
Something really nasty happened - panic !
********************************************************************/
@@ -1557,7 +1549,7 @@
#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 @@
}
/*******************************************************************
+ 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.
********************************************************************/
More information about the samba-cvs
mailing list