summaryrefslogtreecommitdiff
path: root/windows
diff options
context:
space:
mode:
authorVincent Sanders <vince@netsurf-browser.org>2013-05-23 11:50:57 +0100
committerVincent Sanders <vince@netsurf-browser.org>2013-05-23 11:50:57 +0100
commit35dacc36716bdac66bc2673a6725083dc265d310 (patch)
tree25592a597fcb355c71b0cb6feabc48f703de023b /windows
parent12ff7a47f4426bc44103f0123d44fc111608ae18 (diff)
downloadnetsurf-35dacc36716bdac66bc2673a6725083dc265d310.tar.gz
netsurf-35dacc36716bdac66bc2673a6725083dc265d310.tar.bz2
move the logging initialisation out to be call by frontends
This allows each frontend to pass a distinct callback to configure the output file stream appropriately for their use.
Diffstat (limited to 'windows')
-rw-r--r--windows/main.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/windows/main.c b/windows/main.c
index 19f71dd33..3ead210c7 100644
--- a/windows/main.c
+++ b/windows/main.c
@@ -66,9 +66,9 @@ void gui_quit(void)
}
/**
- * Ensures output stdio stream is available
+ * Ensures output logging stream is available
*/
-bool nslog_ensure(FILE *fptr)
+static bool nslog_ensure(FILE *fptr)
{
/* mwindows compile flag normally invalidates standard io unless
* already redirected
@@ -136,8 +136,17 @@ WinMain(HINSTANCE hInstance, HINSTANCE hLastInstance, LPSTR lpcli, int ncmd)
options_file_location = filepath_find(respaths, "preferences");
+ /* initialise logging - not fatal if it fails but not much we
+ * can do about it
+ */
+ nslog_init(nslog_ensure, &argc, argv);
+
/* initialise netsurf */
- netsurf_init(&argc, &argv, options_file_location, messages);
+ ret = netsurf_init(&argc, &argv, options_file_location, messages);
+ if (ret != NSERROR_OK) {
+ free(options_file_location);
+ return 1;
+ }
free(messages);