summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2010-03-14 18:21:40 +0000
committerjstebbins <[email protected]>2010-03-14 18:21:40 +0000
commit4d1726c2fe7bf4ea48ca679be539da5702e9a1f2 (patch)
treeb833b40eb4b00d137239e0fb230d6a49f850014c
parent70ce62705b318f5ca12791a87e24065401f844cc (diff)
LinGui: use a more portable, elegant way of redirecting stderr to pipe
Thanks to scsi guy for the patch. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3168 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--gtk/src/main.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/gtk/src/main.c b/gtk/src/main.c
index c11ff759a..a6a12fc9d 100644
--- a/gtk/src/main.c
+++ b/gtk/src/main.c
@@ -546,11 +546,8 @@ IoRedirect(signal_user_data_t *ud)
g_free(config);
// Set encoding to raw.
g_io_channel_set_encoding (ud->activity_log, NULL, NULL);
-#if !defined(_WIN32)
- stderr->_fileno = pfd[1];
-#else
- stderr->_file = pfd[1];
-#endif
+ // redirect stderr to the writer end of the pipe
+ dup2(pfd[1], /*stderr*/2);
setvbuf(stderr, NULL, _IONBF, 0);
channel = g_io_channel_unix_new (pfd[0]);
// I was getting an this error: