diff options
author | David Herrmann <dh.herrmann@googlemail.com> | 2012-12-06 14:49:56 +0100 |
---|---|---|
committer | David Herrmann <dh.herrmann@googlemail.com> | 2012-12-06 14:49:56 +0100 |
commit | fd098b828cf3bc92f4de5664daae697bf1f1bccb (patch) | |
tree | 3048520a38cb37a0e9c99895538143e7ea43e0bd /src/kmscon_main.c | |
parent | 4258eb1a6b0067e1fbecfb55b5c9b579b45d0a00 (diff) |
kmscon: ignore SIGPIPE
Ignore SIGPIPE globally. We handle HUP correctly everywhere and this
signal is just annoying.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Diffstat (limited to 'src/kmscon_main.c')
-rw-r--r-- | src/kmscon_main.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/kmscon_main.c b/src/kmscon_main.c index 246df93..4956456 100644 --- a/src/kmscon_main.c +++ b/src/kmscon_main.c @@ -476,11 +476,19 @@ static void app_sig_generic(struct ev_eloop *eloop, ev_eloop_exit(app->eloop); } +static void app_sig_ignore(struct ev_eloop *eloop, + struct signalfd_siginfo *info, + void *data) +{ +} + static void destroy_app(struct kmscon_app *app) { uterm_monitor_unref(app->mon); uterm_vt_master_unref(app->vtm); ev_eloop_rm_eloop(app->vt_eloop); + ev_eloop_unregister_signal_cb(app->eloop, SIGPIPE, app_sig_ignore, + app); ev_eloop_unregister_signal_cb(app->eloop, SIGINT, app_sig_generic, app); ev_eloop_unregister_signal_cb(app->eloop, SIGTERM, app_sig_generic, @@ -514,6 +522,13 @@ static int setup_app(struct kmscon_app *app) goto err_app; } + ret = ev_eloop_register_signal_cb(app->eloop, SIGPIPE, + app_sig_ignore, app); + if (ret) { + log_error("cannot register SIGPIPE signal handler: %d", ret); + goto err_app; + } + ret = ev_eloop_new_eloop(app->eloop, &app->vt_eloop); if (ret) { log_error("cannot create VT eloop object: %d", ret); |