Tests: Fix broken OS-X and Linux builds
authorXiaofan Chen <xiaofanc@gmail.com>
Sun, 24 Feb 2013 05:50:00 +0000 (05:50 +0000)
committerPete Batard <pete@akeo.ie>
Sun, 24 Feb 2013 23:03:32 +0000 (23:03 +0000)
* _dup2 is Windows only. Use dup2 instead
* Breakage was introduced in 76eecc6ce11d1bedee369859899901037dcd4cc2

libusb/version_nano.h
tests/testlib.c

index fbd337f..72343ba 100644 (file)
@@ -1 +1 @@
-#define LIBUSB_NANO 10619
+#define LIBUSB_NANO 10620
index 45bc5d4..77395cb 100644 (file)
@@ -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) {