diff options
author | Matthias Clasen <mclasen@redhat.com> | 2009-10-01 11:41:17 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2009-10-01 11:45:28 -0400 |
commit | 97d15954ad426ea792e1c237dfefe754614a0e9e (patch) | |
tree | 44771107b4124aca9115bd60b403d820463b3ebf /gtk/gtkmain.c | |
parent | 42ad005847e9270d39ef692291fc95dfb96750fb (diff) | |
download | gtk+-97d15954ad426ea792e1c237dfefe754614a0e9e.tar.gz |
Move SIGPIPE suppression to gtk_init and document it
Some people were unhappy with doing it deep inside the lpr print
backend at an unpredictable time, and SIGPIPE is almost never
wanted anyway.
Diffstat (limited to 'gtk/gtkmain.c')
-rw-r--r-- | gtk/gtkmain.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c index e47e1beab3..2bbc96d22b 100644 --- a/gtk/gtkmain.c +++ b/gtk/gtkmain.c @@ -686,6 +686,8 @@ do_post_parse_initialization (int *argc, gettext_initialization (); + signal (SIGPIPE, SIG_IGN); + if (g_fatal_warnings) { GLogLevelFlags fatal_mask; @@ -985,6 +987,15 @@ gtk_init_check (int *argc, * the GUI for some reason. If you want your program to fall back to a * textual interface you want to call gtk_init_check() instead. * </para></note> + * + * <note><para> + * Since 2.18, GTK+ calls <literal>signal (SIGPIPE, SIG_IGN)</literal> + * during initialization, to ignore SIGPIPE signals, since these are + * almost never wanted in graphical applications. If you do need to + * handle SIGPIPE for some reason, reset the handler after gtk_init(), + * but notice that other libraries (e.g. libdbus or gvfs) might do + * similar things. + * </para></note> **/ void gtk_init (int *argc, char ***argv) |