]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkmain.c
Merge branch 'master' into toolpalette
[~andy/gtk] / gtk / gtkmain.c
index e47e1beab367e715114caf5f9e587a89ff02310c..bfee6da93b31b179209c00c1f5ec8aea310de0a7 100644 (file)
@@ -686,6 +686,10 @@ do_post_parse_initialization (int    *argc,
 
   gettext_initialization ();
 
+#ifdef SIGPIPE
+  signal (SIGPIPE, SIG_IGN);
+#endif
+
   if (g_fatal_warnings)
     {
       GLogLevelFlags fatal_mask;
@@ -845,9 +849,9 @@ gtk_get_option_group (gboolean open_default_display)
 gboolean
 gtk_init_with_args (int            *argc,
                    char         ***argv,
-                   char           *parameter_string,  
+                   const char     *parameter_string,
                    GOptionEntry   *entries,
-                   char           *translation_domain,
+                   const char     *translation_domain,
                    GError        **error)
 {
   GOptionContext *context;
@@ -985,6 +989,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)