Coverity fixes
[claws.git] / src / crash.c
index f2c59eddd403d35e58659bb15a11d36c42f82ab4..d3c5022af0558494781a01cd7c089d8c6182f720 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 2002-2011 by the Claws Mail Team
+ * Copyright (C) 2002-2012 by the Claws Mail Team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -42,7 +42,7 @@
 #      include <sys/utsname.h>
 #endif
 
-#if defined(__GNU_LIBRARY__)
+#if defined(__GNU_LIBRARY__) && !defined(__UCLIBC__)
 #      include <gnu/libc-version.h>
 #endif
 
@@ -53,6 +53,7 @@
 #include "filesel.h"
 #include "version.h"
 #include "prefs_common.h"
+#include "manage_window.h"
 
 /*
  * NOTE: the crash dialog is called when claws is not 
@@ -272,6 +273,8 @@ static GtkWidget *crash_dialog_show(const gchar *text, const gchar *debug_output
        g_signal_connect(G_OBJECT(button5), "clicked",
                         G_CALLBACK(crash_create_bug_report), NULL);
 
+       MANAGE_WINDOW_SIGNALS_CONNECT(window1);
+
        gtk_widget_show(window1);
 
        gtk_main();
@@ -330,7 +333,10 @@ static void crash_debug(unsigned long crash_pid,
        int choutput[2];
        pid_t pid;
 
-       pipe(choutput);
+       if (pipe(choutput) == -1) {
+               g_print("can't pipe - error %s", errno);
+               return;
+       }
 
        if (0 == (pid = fork())) {
                char *argp[10];
@@ -403,9 +409,6 @@ static void crash_debug(unsigned long crash_pid,
 static const gchar *get_compiled_in_features(void)
 {
        return g_strdup_printf("%s",
-#if USE_THREADS
-                  " gthread"
-#endif
 #if INET6
                   " IPv6"
 #endif
@@ -443,7 +446,9 @@ static const gchar *get_compiled_in_features(void)
  */
 static const gchar *get_lib_version(void)
 {
-#if defined(__GNU_LIBRARY__)
+#if defined(__UCLIBC__)
+       return g_strdup_printf("uClibc %i.%i.%i", __UCLIBC_MAJOR__, __UCLIBC_MINOR__, __UCLIBC_SUBLEVEL__);
+#elif defined(__GNU_LIBRARY__)
        return g_strdup_printf("GNU libc %s", gnu_get_libc_version());
 #else
        return g_strdup(_("Unknown"));