aboutsummaryrefslogtreecommitdiffstats
path: root/src/redshift.c
diff options
context:
space:
mode:
authorJon Lund Steffensen <jonlst@gmail.com>2010-01-07 20:12:38 +0100
committerJon Lund Steffensen <jonlst@gmail.com>2010-01-07 20:12:38 +0100
commita29a578b3289db3b831ff3edbb5f3221dc4ba306 (patch)
treebd953574e647f2f8e9482417ac6eb42fb97a48b5 /src/redshift.c
parentUpdate README (diff)
downloadredshift-ng-a29a578b3289db3b831ff3edbb5f3221dc4ba306.tar.gz
redshift-ng-a29a578b3289db3b831ff3edbb5f3221dc4ba306.tar.bz2
redshift-ng-a29a578b3289db3b831ff3edbb5f3221dc4ba306.tar.xz
Handle both INT and TERM signals as exit signals.
Diffstat (limited to 'src/redshift.c')
-rw-r--r--src/redshift.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/redshift.c b/src/redshift.c
index 75e0d9c..e924d61 100644
--- a/src/redshift.c
+++ b/src/redshift.c
@@ -434,7 +434,7 @@ main(int argc, char *argv[])
float adjustment_alpha = 0.0;
- /* Install signal handler for SIGINT */
+ /* Install signal handler for INT and TERM signals */
struct sigaction sigact;
sigset_t sigset;
@@ -443,6 +443,7 @@ main(int argc, char *argv[])
sigact.sa_mask = sigset;
sigact.sa_flags = 0;
sigaction(SIGINT, &sigact, NULL);
+ sigaction(SIGTERM, &sigact, NULL);
/* Continously adjust color temperature */
int done = 0;