dir/vol: Die() really does
authorGarrett Wollman <wollman@csail.mit.edu>
Tue, 9 Aug 2011 03:19:22 +0000 (23:19 -0400)
committerDerrick Brashear <shadow@dementia.org>
Wed, 10 Aug 2011 03:52:56 +0000 (20:52 -0700)
Die() is an abort routine shared by the dir and vol modules.  Move its
prototype into dir.h to ensure that its declaration matches its three
different definitions, and add an AFS_NORETURN annotation so that the
static analyzer knows that it aborts.

Change-Id: If01f35fe796708f6187b9767497a32458888ec1c
Reviewed-on: http://gerrit.openafs.org/5177
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

src/dir/buffer.c
src/dir/dir.h
src/dir/salvage.c
src/viced/viced.c
src/vol/physio.c
src/volser/physio.c

index e903345..2197b27 100644 (file)
@@ -93,8 +93,6 @@ extern void FidZap(dir_file_t);
 extern int  FidVolEq(dir_file_t, afs_int32 vid);
 extern void FidCpy(dir_file_t, dir_file_t fromfile);
 
-extern void Die(char *msg);
-
 int
 DStat(int *abuffers, int *acalls, int *aios)
 {
index f5f98d7..3d1055a 100644 (file)
@@ -84,6 +84,7 @@ typedef struct dcache * dir_file_t;
 #else
 struct DirHandle;
 typedef struct DirHandle * dir_file_t;
+extern void Die(const char *msg) AFS_NORETURN;
 #endif
 
 extern int afs_dir_NameBlobs(char *name);
index d984c11..a20a67d 100644 (file)
@@ -22,8 +22,6 @@
 /* Defined in vol/vol-salvage.c */
 extern void Log(const char *format, ...)
     AFS_ATTRIBUTE_FORMAT(__printf__, 1, 2);
-/* Defined in vol/physio.c */
-extern void Die(char *);
 
 #define printf Log             /* To make it work with volume salvager */
 
index 6cc25ab..b36c2ea 100644 (file)
@@ -1521,7 +1521,7 @@ CheckParms(void)
 
 /* Miscellaneous routines */
 void
-Die(char *msg)
+Die(const char *msg)
 {
 
     ViceLogThenPanic(0, ("%s\n", msg));
index d7191b9..c41584d 100644 (file)
@@ -155,7 +155,7 @@ FidCpy(DirHandle * tofile, DirHandle * fromfile)
 }
 
 void
-Die(char *msg)
+Die(const char *msg)
 {
     printf("%s\n", msg);
     osi_Panic("%s\n", msg);
index b988793..0045100 100644 (file)
@@ -142,7 +142,7 @@ FidCpy(DirHandle * tofile, DirHandle * fromfile)
 }
 
 void
-Die(char *msg)
+Die(const char *msg)
 {
     printf("%s\n", msg);
     osi_Panic("%s\n", msg);