Make UKERNEL's panic() a real function, not a macro
authorBen Kaduk <kaduk@mit.edu>
Wed, 8 May 2013 16:50:27 +0000 (12:50 -0400)
committerDerrick Brashear <shadow@your-file-system.com>
Thu, 11 Jul 2013 02:45:56 +0000 (19:45 -0700)
In particular, a varargs function, so that osi_Panic() can always
call panic() as varargs.

Change-Id: I2ceee737c0025c146a8cd17b16d6c159e2bbf9d0
Reviewed-on: http://gerrit.openafs.org/9877
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

src/afs/UKERNEL/sysincludes.h

index b94eea5..e401956 100644 (file)
@@ -836,7 +836,15 @@ enum usr_uio_rw { USR_UIO_READ, USR_UIO_WRITE };
 #endif
 #define NBPG                   4096
 
-#define panic(S)               do{fprintf(stderr, "%s", S);assert(0);}while(0)
+static_inline void panic(const char *format, ...) AFS_NORETURN;
+static_inline void panic(const char *format, ...)
+{
+    va_list ap;
+    va_start(ap, format);
+    vfprintf(stderr, format, ap);
+    va_end(ap);
+    assert(0);
+};
 #define abort()                        assert(0)
 #define usr_assert(A)          assert(A)