diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-04-13 02:36:19 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-04-13 02:36:19 +0200 |
commit | a337c6fcee2ab43bf791968f265a0a937715a3ff (patch) | |
tree | ae16633e49c9e09e9d25d162240b455ba1c5cbeb /util.c | |
parent | 0d87eb4279034d7806a08d128972558c8ba573ff (diff) |
main: when ignoring a signal set SA_RESTART
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -658,7 +658,6 @@ char *strstrip(char *s) { *s = 0; return s; - } char *delete_chars(char *s, const char *bad) { @@ -1637,6 +1636,16 @@ int release_terminal(void) { return r; } +int ignore_signal(int sig) { + struct sigaction sa; + + zero(sa); + sa.sa_handler = SIG_IGN; + sa.sa_flags = SA_RESTART; + + return sigaction(sig, &sa, NULL); +} + static const char *const ioprio_class_table[] = { [IOPRIO_CLASS_NONE] = "none", [IOPRIO_CLASS_RT] = "realtime", |