From 734bb14468cb071e22b45895e7bad21dda70fb2a Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Wed, 10 Feb 2010 13:52:43 -0500 Subject: [PATCH] tweak osi_Panic until all platforms can grok stdarg for now, just move it to the end of the file Change-Id: I7bab901be76fabb75f688096e9637caada883816 Reviewed-on: http://gerrit.openafs.org/1286 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/rx/rx_kcommon.c | 87 +++++++++++++++++++++++---------------------- 1 file changed, 44 insertions(+), 43 deletions(-) diff --git a/src/rx/rx_kcommon.c b/src/rx/rx_kcommon.c index 7aa71a964..2f285108c 100644 --- a/src/rx/rx_kcommon.c +++ b/src/rx/rx_kcommon.c @@ -122,46 +122,6 @@ rxi_GetUDPSocket(u_short port) return rxi_GetHostUDPSocket(htonl(INADDR_ANY), port); } -#if !defined(AFS_LINUX26_ENV) -void -#if defined(AFS_AIX_ENV) || defined(AFS_SGI_ENV) -osi_Panic(char *msg, void *a1, void *a2, void *a3) -#else -osi_Panic(char *msg, ...) -#endif -{ -#if defined(AFS_AIX_ENV) || defined(AFS_SGI_ENV) - if (!msg) - msg = "Unknown AFS panic"; - printf(msg, a1, a2, a3); - panic(msg); -#elif (defined(AFS_DARWIN80_ENV) && !defined(AFS_DARWIN90_ENV)) || (defined(AFS_LINUX22_ENV) && !defined(AFS_LINUX_26_ENV)) - char buf[256]; - va_list ap; - if (!msg) - msg = "Unknown AFS panic"; - - va_start(ap, msg); - vsnprintf(buf, sizeof(buf), msg, ap); - va_end(ap); - printf(buf); - panic(buf); -#else - va_list ap; - if (!msg) - msg = "Unknown AFS panic"; - - va_start(ap, msg); - vprintf(msg, ap); - va_end(ap); -# ifdef AFS_LINUX20_ENV - * ((char *) 0) = 0; -# else - panic(msg); -# endif -#endif -} - /* * osi_utoa() - write the NUL-terminated ASCII decimal form of the given * unsigned long value into the given buffer. Returns 0 on success, @@ -232,6 +192,7 @@ osi_utoa(char *buf, size_t len, unsigned long val) return 0; } +#ifndef AFS_LINUX26_ENV /* * osi_AssertFailK() -- used by the osi_Assert() macro. * @@ -1074,7 +1035,7 @@ rxk_FreeSocket(struct socket *asocket) #endif /* !SUN5 && !LINUX20 */ #if defined(RXK_LISTENER_ENV) || defined(AFS_SUN5_ENV) -#ifdef AFS_DARWIN80_ENV +#if 0/*def AFS_DARWIN80_ENV*/ /* Shutting down should wake us up, as should an earlier event. */ void rxi_ReScheduleEvents(void) @@ -1111,7 +1072,7 @@ afs_rxevent_daemon(void) afs_Trace1(afs_iclSetp, CM_TRACE_TIMESTAMP, ICL_TYPE_STRING, "before afs_osi_Wait()"); #endif -#ifdef AFS_DARWIN80_ENV +#if 0/*def AFS_DARWIN80_ENV*/ afs_osi_TimedSleep(&afs_termState, ((temp.sec * 1000) + (temp.usec / 1000)), 0); #else @@ -1343,5 +1304,45 @@ osi_StopListener(void) } #endif #endif /* RXK_LISTENER_ENV */ - #endif /* !NCR && !UKERNEL */ + +#if !defined(AFS_LINUX26_ENV) +void +#if defined(AFS_AIX_ENV) || defined(AFS_SGI_ENV) +osi_Panic(char *msg, void *a1, void *a2, void *a3) +#else +osi_Panic(char *msg, ...) +#endif +{ +#if defined(AFS_AIX_ENV) || defined(AFS_SGI_ENV) + if (!msg) + msg = "Unknown AFS panic"; + printf(msg, a1, a2, a3); + panic(msg); +#elif (defined(AFS_DARWIN80_ENV) && !defined(AFS_DARWIN90_ENV)) || (defined(AFS_LINUX22_ENV) && !defined(AFS_LINUX_26_ENV)) + char buf[256]; + va_list ap; + if (!msg) + msg = "Unknown AFS panic"; + + va_start(ap, msg); + vsnprintf(buf, sizeof(buf), msg, ap); + va_end(ap); + printf(buf); + panic(buf); +#else + va_list ap; + if (!msg) + msg = "Unknown AFS panic"; + + va_start(ap, msg); + vprintf(msg, ap); + va_end(ap); +# ifdef AFS_LINUX20_ENV + * ((char *) 0) = 0; +# else + panic(msg); +# endif +#endif +} +#endif -- 2.39.5