Eric Blake <ebb9 <at> byu.net> writes: > always report ASSERT failures to the original stderr, > regardless of what the test did to fd 2.
Well, it would work if mingw's dup2 weren't broken. On mingw, dup2 always returns 0 for success, rather than the fd just opened. > + /* We might close fd 2 later, so save it in fd 10. */ > + if (dup2 (STDERR_FILENO, 10) != 10 > + || (myerr = fdopen (10, "w")) == NULL) > + return 2; > + return parent_main (argc, argv); > } So I guess I'll start the process of writing a dup2 replacement module; meanwhile, we can just use the hack of checking that the dup2 result in this test was non-negative. -- Eric Blake