mirror of
https://github.com/tstellar/bygfoot.git
synced 2025-01-19 02:10:41 +01:00
Redirect stderr and stdout to a file stderr.txt and stdout.txt respectively
This commit is contained in:
parent
7e7fdc3ca4
commit
cf11b37bd0
10
src/main.c
10
src/main.c
@ -30,6 +30,9 @@
|
||||
|
||||
#include <time.h>
|
||||
#include <glib/gprintf.h>
|
||||
#include <glib.h>
|
||||
#include <io.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "bet_struct.h"
|
||||
#include "debug.h"
|
||||
@ -324,7 +327,12 @@ main (gint argc, gchar *argv[])
|
||||
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
|
||||
textdomain (GETTEXT_PACKAGE);
|
||||
#endif
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
int fd1 = open ("stdout.log", O_CREAT|O_WRONLY|O_TRUNC, 0666);
|
||||
dup2 (fd1, 1);
|
||||
int fd2 = open ("stderr.log", O_CREAT|O_WRONLY|O_TRUNC, 0666);
|
||||
dup2 (fd2, 2);
|
||||
#endif
|
||||
gtk_set_locale ();
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user