diff options
Diffstat (limited to 'sesman/thread.c')
-rw-r--r-- | sesman/thread.c | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/sesman/thread.c b/sesman/thread.c index 986a5d27..98a92533 100644 --- a/sesman/thread.c +++ b/sesman/thread.c @@ -22,7 +22,7 @@ * @file thread.c * @brief thread stuff... * @author Simone Fedele - * + * */ #include "sesman.h" @@ -62,14 +62,14 @@ thread_sighandler_start(void) sigaddset(&waitmask, SIGFPE); pthread_sigmask(SIG_UNBLOCK, &waitmask, NULL); - log_message(&(g_cfg->log), LOG_LEVEL_INFO,"starting signal handling thread..."); + log_message(LOG_LEVEL_INFO,"starting signal handling thread..."); ret = pthread_create(&g_thread_sighandler, NULL, sig_handler_thread, ""); pthread_detach(g_thread_sighandler); if (ret == 0) { - log_message(&(g_cfg->log), LOG_LEVEL_INFO, "signal handler thread started successfully"); + log_message(LOG_LEVEL_INFO, "signal handler thread started successfully"); return 0; } @@ -77,16 +77,16 @@ thread_sighandler_start(void) switch (ret) { case EINVAL: - log_message(&(g_cfg->log), LOG_LEVEL_ERROR, "invalid attributes for signal handling thread (creation returned EINVAL)"); + log_message(LOG_LEVEL_ERROR, "invalid attributes for signal handling thread (creation returned EINVAL)"); break; case EAGAIN: - log_message(&(g_cfg->log), LOG_LEVEL_ERROR, "not enough resources to start signal handling thread (creation returned EAGAIN)"); + log_message(LOG_LEVEL_ERROR, "not enough resources to start signal handling thread (creation returned EAGAIN)"); break; case EPERM: - log_message(&(g_cfg->log), LOG_LEVEL_ERROR, "invalid permissions for signal handling thread (creation returned EPERM)"); + log_message(LOG_LEVEL_ERROR, "invalid permissions for signal handling thread (creation returned EPERM)"); break; default: - log_message(&(g_cfg->log), LOG_LEVEL_ERROR, "unknown error starting signal handling thread"); + log_message(LOG_LEVEL_ERROR, "unknown error starting signal handling thread"); } return 1; @@ -100,13 +100,13 @@ thread_session_update_start(void) int ret; //starts the session update thread //that checks for idle time, destroys sessions, ecc... - -#warning this thread should always request lock_fork before read or write + +#warning this thread should always request lock_fork before read or write #warning (so we can Fork() In Peace) ret = pthread_create(&g_thread_updater, NULL, , ""); pthread_detach(g_thread_updater); - if (ret==0) + if (ret == 0) { log_message(&(g_cfg->log), LOG_LEVEL_INFO, "session update thread started successfully"); return 0; @@ -116,16 +116,16 @@ thread_session_update_start(void) switch (ret) { case EINVAL: - log_message(&(g_cfg->log), LOG_LEVEL_ERROR, "invalid attributes for session update thread (creation returned EINVAL)"); + log_message(LOG_LEVEL_ERROR, "invalid attributes for session update thread (creation returned EINVAL)"); break; case EAGAIN: - log_message(&(g_cfg->log), LOG_LEVEL_ERROR, "not enough resources to start session update thread (creation returned EAGAIN)"); + log_message(LOG_LEVEL_ERROR, "not enough resources to start session update thread (creation returned EAGAIN)"); break; case EPERM: - log_message(&(g_cfg->log), LOG_LEVEL_ERROR, "invalid permissions for session update thread (creation returned EPERM)"); + log_message(LOG_LEVEL_ERROR, "invalid permissions for session update thread (creation returned EPERM)"); break; default: - log_message(&(g_cfg->log), LOG_LEVEL_ERROR, "unknown error starting session update thread"); + log_message(LOG_LEVEL_ERROR, "unknown error starting session update thread"); } return 1; @@ -148,9 +148,9 @@ thread_scp_start(int skt) //ret = pthread_create(&th, NULL, scp_process_start, (void*) (&g_thread_sck)); pthread_detach(th); - if (ret == 0) + if (ret == 0) { - log_message(&(g_cfg->log), LOG_LEVEL_INFO, "scp thread on sck %d started successfully", skt); + log_message(LOG_LEVEL_INFO, "scp thread on sck %d started successfully", skt); return 0; } @@ -158,18 +158,17 @@ thread_scp_start(int skt) switch (ret) { case EINVAL: - log_message(&(g_cfg->log), LOG_LEVEL_ERROR, "invalid attributes for scp thread on sck %d (creation returned EINVAL)", skt); + log_message(LOG_LEVEL_ERROR, "invalid attributes for scp thread on sck %d (creation returned EINVAL)", skt); break; case EAGAIN: - log_message(&(g_cfg->log), LOG_LEVEL_ERROR, "not enough resources to start scp thread on sck %d (creation returned EAGAIN)", skt); + log_message(LOG_LEVEL_ERROR, "not enough resources to start scp thread on sck %d (creation returned EAGAIN)", skt); break; case EPERM: - log_message(&(g_cfg->log), LOG_LEVEL_ERROR, "invalid permissions for scp thread on sck %d (creation returned EPERM)", skt); + log_message(LOG_LEVEL_ERROR, "invalid permissions for scp thread on sck %d (creation returned EPERM)", skt); break; default: - log_message(&(g_cfg->log), LOG_LEVEL_ERROR, "unknown error starting scp thread on sck %d"); + log_message(LOG_LEVEL_ERROR, "unknown error starting scp thread on sck %d"); } return 1; } - |