summaryrefslogtreecommitdiff
path: root/recordmydesktop/src/rmd_register_callbacks.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2020-06-19 03:47:43 -0700
committerVito Caputo <vcaputo@pengaru.com>2020-06-20 15:58:17 -0700
commit2e5fdc7f842eacce7b41eab794c4bfe97761e381 (patch)
tree4f11cd5aa2196a85c531c1eeb6c75ddb4b190465 /recordmydesktop/src/rmd_register_callbacks.c
parentc903c20a8554bd5a56fbe95f6598662e9fc0d2b6 (diff)
*: just some fast and nasty reformatting
If I'm going to actually be modifying this program substantially and possibly maintaining some fork of it, it's gotta be formmatted how I prefer. This is by no means done or perfect, rmd_types.h in particular is quite the mess, I will be revisiting this issue...
Diffstat (limited to 'recordmydesktop/src/rmd_register_callbacks.c')
-rw-r--r--recordmydesktop/src/rmd_register_callbacks.c68
1 files changed, 34 insertions, 34 deletions
diff --git a/recordmydesktop/src/rmd_register_callbacks.c b/recordmydesktop/src/rmd_register_callbacks.c
index 844fece..241f160 100644
--- a/recordmydesktop/src/rmd_register_callbacks.c
+++ b/recordmydesktop/src/rmd_register_callbacks.c
@@ -34,53 +34,53 @@
// There seem to be no way of passing user data to the signal handler,
// so hack around not being able to pass ProgData to them
-static int *pdata_running = NULL;
-static int *pdata_paused = NULL;
-static int *pdata_aborted = NULL;
+static int *pdata_running = NULL;
+static int *pdata_paused = NULL;
+static int *pdata_aborted = NULL;
static int *pdata_pause_state_changed = NULL;
static void rmdSetPaused(int signum) {
- *pdata_pause_state_changed = TRUE;
+ *pdata_pause_state_changed = TRUE;
}
static void rmdSetRunning(int signum) {
- if (!*pdata_paused) {
+ if (!*pdata_paused) {
- *pdata_running = FALSE;
+ *pdata_running = FALSE;
- if (signum == SIGABRT) {
- *pdata_aborted = TRUE;
- }
- }
+ if (signum == SIGABRT) {
+ *pdata_aborted = TRUE;
+ }
+ }
}
void rmdRegisterCallbacks(ProgData *pdata) {
- struct sigaction pause_act;
- struct sigaction end_act;
-
- // Is there some way to pass pdata to the signal handlers?
- pdata_running = &pdata->running;
- pdata_paused = &pdata->paused;
- pdata_aborted = &pdata->aborted;
- pdata_pause_state_changed = &pdata->pause_state_changed;
-
- // Setup pause_act
- sigfillset(&pause_act.sa_mask);
- pause_act.sa_flags = SA_RESTART;
- pause_act.sa_handler = rmdSetPaused;
-
- sigaction(SIGUSR1, &pause_act, NULL);
-
- // Setup end_act
- sigfillset(&end_act.sa_mask);
- end_act.sa_flags = SA_RESTART;
- end_act.sa_handler = rmdSetRunning;
-
- sigaction(SIGINT, &end_act, NULL);
- sigaction(SIGTERM, &end_act, NULL);
- sigaction(SIGABRT, &end_act, NULL);
+ struct sigaction pause_act;
+ struct sigaction end_act;
+
+ // Is there some way to pass pdata to the signal handlers?
+ pdata_running = &pdata->running;
+ pdata_paused = &pdata->paused;
+ pdata_aborted = &pdata->aborted;
+ pdata_pause_state_changed = &pdata->pause_state_changed;
+
+ // Setup pause_act
+ sigfillset(&pause_act.sa_mask);
+ pause_act.sa_flags = SA_RESTART;
+ pause_act.sa_handler = rmdSetPaused;
+
+ sigaction(SIGUSR1, &pause_act, NULL);
+
+ // Setup end_act
+ sigfillset(&end_act.sa_mask);
+ end_act.sa_flags = SA_RESTART;
+ end_act.sa_handler = rmdSetRunning;
+
+ sigaction(SIGINT, &end_act, NULL);
+ sigaction(SIGTERM, &end_act, NULL);
+ sigaction(SIGABRT, &end_act, NULL);
}
© All Rights Reserved