From: Garrett Wollman Date: Sat, 9 Jul 2011 02:40:27 +0000 (-0400) Subject: viced: indent nested preprocessor directives X-Git-Tag: openafs-devel-1_7_1~316 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=53434c828d0fed96a90e8f984460c323282c4d7b;hp=99b43273c0203881ea3d2d50f0abf000cdc0b03e viced: indent nested preprocessor directives Make viced.c look more like other source files by indenting nested preprocessor directives. In a few case it made more sense to eliminate the nesting. This should otherwise be a whitespace-only chnage. Change-Id: I895ea2f754f90a15daa73cea24d3da9576fff9c9 Reviewed-on: http://gerrit.openafs.org/4959 Reviewed-by: Simon Wilkinson Tested-by: Simon Wilkinson Reviewed-by: Derrick Brashear --- diff --git a/src/viced/viced.c b/src/viced/viced.c index 6e79eaf..3aaa621 100644 --- a/src/viced/viced.c +++ b/src/viced/viced.c @@ -26,16 +26,16 @@ #include #ifdef AFS_NT40_ENV -#include -#include +# include +# include #endif #ifdef HAVE_SYS_FILE_H -#include +# include #endif #ifdef HAVE_SYS_RESOURCE_H -#include +# include #endif #undef SHARED @@ -68,17 +68,17 @@ #include #include #ifndef AFS_NT40_ENV -#include +# include #endif #include "viced_prototypes.h" #include "viced.h" #include "host.h" #ifdef AFS_PTHREAD_ENV -#include +# include #endif #if defined(AFS_SGI_ENV) -#include "sys/schedctl.h" -#include "sys/lock.h" +# include "sys/schedctl.h" +# include "sys/lock.h" #endif #include @@ -104,7 +104,7 @@ char fsync_wait[1]; #endif /* AFS_PTHREAD_ENV */ #ifdef AFS_NT40_ENV -#define NT_OPEN_MAX 1024 /* This is an arbitrary no. we came up with for +# define NT_OPEN_MAX 1024 /* This is an arbitrary no. we came up with for * now. We hope this will be replaced by a more * intelligent estimate later. */ #endif @@ -213,11 +213,11 @@ static void FlagMsg(void); * disk */ -#if !defined(PTHREAD_RWLOCK_INITIALIZER) && defined(AFS_DARWIN80_ENV) -#define PTHREAD_RWLOCK_INITIALIZER {0x2DA8B3B4, {0}} -#endif +# if !defined(PTHREAD_RWLOCK_INITIALIZER) && defined(AFS_DARWIN80_ENV) +# define PTHREAD_RWLOCK_INITIALIZER {0x2DA8B3B4, {0}} +# endif -#ifndef AFS_NT40_ENV +# ifndef AFS_NT40_ENV struct fs_state fs_state = { FS_MODE_NORMAL, 0, @@ -228,7 +228,7 @@ struct fs_state fs_state = PTHREAD_COND_INITIALIZER, PTHREAD_RWLOCK_INITIALIZER }; -#else /* AFS_NT40_ENV */ +# else /* AFS_NT40_ENV */ struct fs_state fs_state; static int fs_stateInit(void) @@ -247,7 +247,7 @@ static int fs_stateInit(void) CV_INIT(&fs_state.worker_done_cv, "worker done", CV_DEFAULT, 0); osi_Assert(pthread_rwlock_init(&fs_state.state_lock, NULL) == 0); } -#endif /* AFS_NT40_ENV */ +# endif /* AFS_NT40_ENV */ #endif /* AFS_DEMAND_ATTACH_FS */ /* @@ -330,13 +330,11 @@ ResetCheckSignal(void) #if defined(AFS_HPUX_ENV) signo = SIGPOLL; -#else -#if defined(AFS_NT40_ENV) +#elif defined(AFS_NT40_ENV) signo = SIGUSR2; #else signo = SIGXCPU; #endif -#endif #if defined(AFS_PTHREAD_ENV) && !defined(AFS_NT40_ENV) softsig_signal(signo, CheckSignal_Signal); @@ -349,11 +347,11 @@ static void ResetCheckDescriptors(void) { #ifndef AFS_NT40_ENV -#if defined(AFS_PTHREAD_ENV) +# if defined(AFS_PTHREAD_ENV) softsig_signal(SIGTERM, CheckDescriptors_Signal); -#else +# else (void)signal(SIGTERM, CheckDescriptors_Signal); -#endif +# endif #endif } @@ -370,22 +368,22 @@ int viced_syscall(afs_uint32 a3, afs_uint32 a4, void *a5) { afs_uint32 rcode; -#ifndef AFS_LINUX20_ENV +# ifndef AFS_LINUX20_ENV void (*old) (int); old = (void (*)(int))signal(SIGSYS, SIG_IGN); -#endif +# endif rcode = syscall(AFS_SYSCALL, 28 /* AFSCALL_CALL */ , a3, a4, a5); -#ifndef AFS_LINUX20_ENV +# ifndef AFS_LINUX20_ENV signal(SIGSYS, old); -#endif +# endif return rcode; } #endif #if !defined(AFS_NT40_ENV) -#include "AFS_component_version_number.c" +# include "AFS_component_version_number.c" #endif /* !AFS_NT40_ENV */ #define MAXADMINNAME 64 @@ -666,15 +664,15 @@ ClearXStatValues(void) * declared in param.h. If such a thing is not defined, we bitch * and declare ourselves to be an unknown system type. */ -#ifdef SYS_NAME_ID +# ifdef SYS_NAME_ID afs_perfstats.sysname_ID = SYS_NAME_ID; -#else -#ifndef AFS_NT40_ENV +# else +# ifndef AFS_NT40_ENV ViceLog(0, ("Sys name ID constant not defined in param.h!!\n")); ViceLog(0, ("[Choosing ``undefined'' sys name ID.\n")); -#endif +# endif afs_perfstats.sysname_ID = SYS_NAME_ID_UNDEFINED; -#endif /* SYS_NAME_ID */ +# endif /* SYS_NAME_ID */ #endif } /*ClearXStatValues */ @@ -1041,14 +1039,12 @@ ParseRights(char *arights) static int max_fileserver_thread(void) { -#if defined(AFS_PTHREAD_ENV) -#if defined(AFS_AIX_ENV) || defined(AFS_HPUX_ENV) +#if defined(AFS_PTHREAD_ENV) && (defined(AFS_AIX_ENV) || defined(AFS_HPUX_ENV)) long ans; ans = sysconf(_SC_THREAD_THREADS_MAX); if (0 < ans && ans < MAX_FILESERVER_THREAD) return (int)ans; -#endif #endif /* defined(AFS_PTHREAD_ENV) */ return MAX_FILESERVER_THREAD; } @@ -1996,11 +1992,9 @@ main(int argc, char *argv[]) schedctl(NDPRI, 0, NDPNORMMAX); if (SawLock) plock(PROCLOCK); -#else -#ifndef AFS_NT40_ENV +#elif !defined(AFS_NT40_ENV) nice(-5); /* TODO: */ #endif -#endif DInit(buffs); #ifdef AFS_DEMAND_ATTACH_FS FS_STATE_INIT;