On Dec 16, 2007, at 7:55 AM, Johannes Schindelin wrote:

On Sat, 8 Dec 2007, Johannes Sixt wrote:

On Saturday 08 December 2007 16:05, Steffen Prohaska wrote:
I merged mingw/master (bd8d78a1) and pushed the result to
work/merge-mingw (a1e84247) in 4msysgit.

I disabled testing of git commit --interactive because we do not yet
support Git.pm.

t7502-commit.sh freezes on "git status -v". I suspect this is related to the "dup-dance" in wt_status_print_verbose(). But I'm not sure and have no further idea how to fix this. When I run "git status -v" from
the command line it works. But if it is run from the test script it
freezes.

When I run git-status in the debugger, it freezes, too. It happens at
the first printf() after the dup-dance. I don't remember the exact
function, though. So, your suspicion is correct, but I don't have a
solution, either.

This works, but don't ask me why:

Maybe we should just take it...


---

 wt-status.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/wt-status.c b/wt-status.c
index 51c1879..2bfe60f 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -328,7 +328,7 @@ static void wt_status_print_verbose(struct wt_status *s)
        /* Sigh, the entire diff machinery is hardcoded to output to
         * stdout.  Do the dup-dance...*/
        saved_stdout = dup(STDOUT_FILENO);
-       if (saved_stdout < 0 ||dup2(fileno(s->fp), STDOUT_FILENO) < 0)
+       if (saved_stdout < 0 || dup2(dup(fileno(s->fp)), STDOUT_FILENO) < 0)
                die("couldn't redirect stdout\n");

        init_revisions(&rev, NULL);

... but we should save the return of dup(fileno(s->fp) and close
it before leaving the function, no?

An alternative would be to rewrite the diff machinery to accept a
file descriptor.  But I'm not sure if this is worth it.

        Steffen

Reply via email to