summaryrefslogtreecommitdiffstats
path: root/libhb/hb.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2010-05-23 16:26:02 +0000
committerjstebbins <[email protected]>2010-05-23 16:26:02 +0000
commit083b8b8f56b49ad1073d4ae0bb9ab0d6c39f8d6d (patch)
treea3d62aaf938aa86feafb059860c192d2bbae5206 /libhb/hb.c
parenta42237e7c0cf5f19662990ae0b740715c2b67bfd (diff)
fix stderr redirection on mingw. dup2 function doesn't work as it should so must
reach inside stderr struct and modify _file member directly git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3318 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/hb.c')
-rw-r--r--libhb/hb.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libhb/hb.c b/libhb/hb.c
index 9b1631396..001c74c0a 100644
--- a/libhb/hb.c
+++ b/libhb/hb.c
@@ -1750,7 +1750,12 @@ static void redirect_thread_func(void * _data)
{
int pfd[2];
pipe(pfd);
+#if defined( SYS_MINGW )
+ // dup2 doesn't work on windows for some stupid reason
+ stderr->_file = pfd[1];
+#else
dup2(pfd[1], /*stderr*/ 2);
+#endif
FILE * log_f = fdopen(pfd[0], "rb");
char line_buffer[500];