From e2e84c980f5e6f3cdec3fe2c09fc33b8f4c03f39 Mon Sep 17 00:00:00 2001 From: enselic Date: Sat, 13 Sep 2008 10:37:40 +0000 Subject: src/register_callbacks.c: Formating. git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@527 f606c939-3180-4ac9-a4b8-4b8779d57d0a --- recordmydesktop/src/register_callbacks.c | 47 ++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 21 deletions(-) (limited to 'recordmydesktop') diff --git a/recordmydesktop/src/register_callbacks.c b/recordmydesktop/src/register_callbacks.c index c98f55d..79ee3fe 100644 --- a/recordmydesktop/src/register_callbacks.c +++ b/recordmydesktop/src/register_callbacks.c @@ -32,34 +32,39 @@ static void SetPaused(int signum) { - PauseStateChanged=1; - + PauseStateChanged = 1; } - static void SetRunning(int signum) { - if(!Paused){ - *Running=0; - if(signum==SIGABRT) - Aborted=1; - } + if (!Paused){ + *Running = 0; + + if (signum == SIGABRT) { + Aborted = 1; + } + } } +void RegisterCallbacks(ProgArgs *prog_data) { -void RegisterCallbacks(ProgArgs *args){ + struct sigaction pause_act; + struct sigaction end_act; - struct sigaction pause_act,end_act; - - pause_act.sa_handler=SetPaused; - end_act.sa_handler=SetRunning; - sigfillset(&(pause_act.sa_mask)); - sigfillset(&(end_act.sa_mask)); - pause_act.sa_flags=end_act.sa_flags=SA_RESTART; - sigaction(SIGUSR1,&pause_act,NULL); - sigaction(SIGINT,&end_act,NULL); - sigaction(SIGTERM,&end_act,NULL); - sigaction(SIGABRT,&end_act,NULL); -} + // Setup pause_act + sigfillset(&pause_act.sa_mask); + pause_act.sa_flags = SA_RESTART; + pause_act.sa_handler = SetPaused; + + sigaction(SIGUSR1, &pause_act, NULL); + // Setup end_act + sigfillset(&end_act.sa_mask); + end_act.sa_flags = SA_RESTART; + end_act.sa_handler = SetRunning; + + sigaction(SIGINT, &end_act, NULL); + sigaction(SIGTERM, &end_act, NULL); + sigaction(SIGABRT, &end_act, NULL); +} -- cgit v1.2.3