On Sun, Feb 24, 2013 at 1:32 PM, Xiaofan Chen <xiaof...@gmail.com> wrote:
> Actually it breaks Linux build as well. Tested under
> Ubuntu 12.10 x86. The Mac OS X test is done in
> Mac OS X 10.7.5.
>

This is the one which break it. _dup2 is for Windows
and not for Linux and Mac OS X.
https://github.com/libusbx/libusbx/commit/76eecc6ce11d1bedee369859899901037dcd4cc2

The following patch will fix it.

diff --git a/tests/testlib.c b/tests/testlib.c
index 45bc5d4..77395cb 100644
--- a/tests/testlib.c
+++ b/tests/testlib.c
@@ -81,11 +81,11 @@ static void cleanup_test_output(libusbx_testlib_ctx * ctx)
 #ifndef DISABLE_STDOUT_REDIRECTION
        if (!ctx->verbose) {
                if (ctx->old_stdout != INVALID_FD) {
-                       _dup2(ctx->old_stdout, STDOUT_FILENO);
+                       dup2(ctx->old_stdout, STDOUT_FILENO);
                        ctx->old_stdout = INVALID_FD;
                }
                if (ctx->old_stderr != INVALID_FD) {
-                       _dup2(ctx->old_stderr, STDERR_FILENO);
+                       dup2(ctx->old_stderr, STDERR_FILENO);
                        ctx->old_stderr = INVALID_FD;
                }
                if (ctx->null_fd != INVALID_FD) {

-- 
Xiaofan

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to