Hi,
On Sun, 16 Dec 2007, Steffen Prohaska wrote:
> 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?
I pushed a commit to the "mob" branch. Please test, and if you're content
with it, merge to "devel".
> An alternative would be to rewrite the diff machinery to accept a file
> descriptor. But I'm not sure if this is worth it.
diff.c | 296
+++++++++++++++++++++++++++++++++++-----------------------------
diff.h | 1 +
2 files changed, 163 insertions(+), 134 deletions(-)
Hmm.
FWIW I pushed it to the 'diff-no-stdout' branch of
http://repo.or.cz/w/git/dscho.git/
Ciao,
Dscho