summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorenselic <enselic@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2008-09-13 10:37:40 +0000
committerenselic <enselic@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2008-09-13 10:37:40 +0000
commite2e84c980f5e6f3cdec3fe2c09fc33b8f4c03f39 (patch)
tree96a63bcaa201482bc0168d47ed65d7f36fe7b752
parentf5d1654b23c33c7394e7481e5301f359cdfd2803 (diff)
src/register_callbacks.c: Formating.
git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@527 f606c939-3180-4ac9-a4b8-4b8779d57d0a
-rw-r--r--recordmydesktop/src/register_callbacks.c47
1 files changed, 26 insertions, 21 deletions
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);
+}
© All Rights Reserved