/* Called at signal interrupt level; queues function to be called * when IOMGR runs again. */ void bnode_Int(int asignal) { if (asignal == SIGQUIT || asignal == SIGTERM) { IOMGR_SoftSig(bozo_ShutdownAndExit, (void *)(intptr_t)asignal); } else { IOMGR_SoftSig(bnode_SoftInt, (void *)(intptr_t)asignal); } }
void SetDebug_Signal(int signo) { if (LogLevel > 0) { LogLevel *= 5; #if defined(AFS_PTHREAD_ENV) if (LogLevel > 1 && threadNumProgram != NULL && threadIdLogs == 0) { threadIdLogs = 1; } #endif } else { LogLevel = 1; #if defined(AFS_PTHREAD_ENV) if (threadIdLogs == 1) threadIdLogs = 0; #endif } printLocks = 2; #if defined(AFS_PTHREAD_ENV) DebugOn((void *)(intptr_t)LogLevel); #else /* AFS_PTHREAD_ENV */ IOMGR_SoftSig(DebugOn, (void *)(intptr_t)LogLevel); #endif /* AFS_PTHREAD_ENV */ (void)signal(signo, SetDebug_Signal); /* on some platforms, this * signal handler needs to * be set again */ } /*SetDebug_Signal */
/*! * Signal handler to increase the logging level. * * Increase the current logging level to 1 if it in currently 0, * otherwise, increase the current logging level by a factor of 5 if it * is currently non-zero. * * Enables thread id logging when the log level is greater than 1. */ void SetDebug_Signal(int signo) { if (LogLevel > 0) { LogLevel *= 5; #if defined(AFS_PTHREAD_ENV) if (LogLevel > 1 && threadNumProgram != NULL && threadIdLogs == 0) { threadIdLogs = 1; } #endif } else { LogLevel = 1; #if defined(AFS_PTHREAD_ENV) if (threadIdLogs == 1) threadIdLogs = 0; #endif } #if defined(AFS_PTHREAD_ENV) DebugOn((void *)(intptr_t)LogLevel); #else /* AFS_PTHREAD_ENV */ IOMGR_SoftSig(DebugOn, (void *)(intptr_t)LogLevel); #endif /* AFS_PTHREAD_ENV */ if (resetSignals) { /* When pthreaded softsig handlers are not in use, some platforms * require this signal handler to be set again. */ (void)signal(signo, SetDebug_Signal); } } /*SetDebug_Signal */
static void CheckSignal_Signal(int unused) { #if defined(AFS_PTHREAD_ENV) CheckSignal(0); #else IOMGR_SoftSig(CheckSignal, 0); #endif }
void ResetDebug_Signal(int signo) { LogLevel = 0; if (printLocks > 0) --printLocks; #if defined(AFS_PTHREAD_ENV) DebugOn((void *)(intptr_t)LogLevel); #else /* AFS_PTHREAD_ENV */ IOMGR_SoftSig(DebugOn, (void *)(intptr_t)LogLevel); #endif /* AFS_PTHREAD_ENV */ (void)signal(signo, ResetDebug_Signal); /* on some platforms, * this signal handler * needs to be set * again */ #if defined(AFS_PTHREAD_ENV) if (threadIdLogs == 1) threadIdLogs = 0; #endif if (mrafsStyleLogs) OpenLog((char *)&ourName); } /*ResetDebug_Signal */
/*! * Signal handler to reset the logging level. * * Reset the logging level and disable thread id logging. * * \note This handler has the side-effect of rotating and reopening * MR-AFS style logs. */ void ResetDebug_Signal(int signo) { LogLevel = 0; #if defined(AFS_PTHREAD_ENV) DebugOn((void *)(intptr_t)LogLevel); #else /* AFS_PTHREAD_ENV */ IOMGR_SoftSig(DebugOn, (void *)(intptr_t)LogLevel); #endif /* AFS_PTHREAD_ENV */ if (resetSignals) { /* When pthreaded softsig handlers are not in use, some platforms * require this signal handler to be set again. */ (void)signal(signo, ResetDebug_Signal); } #if defined(AFS_PTHREAD_ENV) if (threadIdLogs == 1) threadIdLogs = 0; #endif if (serverLogOpts.lopt_rotateOnReset) { RotateLogFile(); } } /*ResetDebug_Signal */