diff options
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/gui.h | 1 | ||||
-rw-r--r-- | desktop/netsurf.c | 26 |
2 files changed, 18 insertions, 9 deletions
diff --git a/desktop/gui.h b/desktop/gui.h index ca557ef8a..f09e5f20f 100644 --- a/desktop/gui.h +++ b/desktop/gui.h @@ -58,6 +58,7 @@ typedef enum { GUI_POINTER_DEFAULT, GUI_POINTER_POINT, GUI_POINTER_CARET, #include "desktop/browser.h" #include "desktop/search.h" +void gui_stdout(void); void gui_init(int argc, char** argv); void gui_init2(int argc, char** argv); void gui_multitask(void); diff --git a/desktop/netsurf.c b/desktop/netsurf.c index a1b7dabae..9acddaf87 100644 --- a/desktop/netsurf.c +++ b/desktop/netsurf.c @@ -23,11 +23,13 @@ #include <stdbool.h> #include <stdio.h> #include <stdlib.h> -#include <sys/utsname.h> + #include <libxml/encoding.h> #include <libxml/globals.h> #include <libxml/xmlversion.h> + #include "utils/config.h" +#include "utils/utsname.h" #include "content/fetch.h" #include "content/fetchcache.h" #include "content/urldb.h" @@ -83,32 +85,38 @@ void netsurf_init(int argc, char** argv) { struct utsname utsname; +#ifdef HAVE_SIGPIPE /* Ignore SIGPIPE - this is necessary as OpenSSL can generate these * and the default action is to terminate the app. There's no easy * way of determining the cause of the SIGPIPE (other than using * sigaction() and some mechanism for getting the file descriptor * out of libcurl). However, we expect nothing else to generate a * SIGPIPE, anyway, so may as well just ignore them all. */ + signal(SIGPIPE, SIG_IGN); +#endif #if !((defined(__SVR4) && defined(__sun)) || defined(__NetBSD__) || \ - defined(__OpenBSD__)) + defined(__OpenBSD__) || defined(_WIN32)) stdout = stderr; #endif if ((argc > 1) && (argv[1][0] == '-') && (argv[1][1] == 'v') && (argv[1][2] == 0)) { - int argcmv; - verbose_log = true; - for (argcmv = 2; argcmv < argc; argcmv++) { - argv[argcmv - 1] = argv[argcmv]; - } - argc--; + int argcmv; + verbose_log = true; + for (argcmv = 2; argcmv < argc; argcmv++) { + argv[argcmv - 1] = argv[argcmv]; + } + argc--; + +#ifndef HAVE_STDOUT + gui_stdout(); +#endif } #ifdef _MEMDEBUG_H_ memdebug_memdebug("memdump"); #endif - LOG(("version '%s'", netsurf_version)); if (uname(&utsname) < 0) LOG(("Failed to extract machine information")); |