Re: [Gimp-developer] [PATCH] fix to batch console support
script fu? .../5/28 Christopher Montgomery > The batch mode console is using stdio but never flushing its output > after fwrite()s. This still usually works by accident when using > batch mode from a terminal, but it means scripts generally won't work > as responses to requests never get flushed through the return pipe. > > Apologies for this not being in git format-patch format, it was a spot > test to get other unit tests working and trivial enough it doesn't > seem worth the extra trouble. > > Cheers, > > Monty > > diff --git a/plug-ins/script-fu/scheme-wrapper.c > b/plug-ins/script-fu/scheme-wrapper.c > index 9212801..fbcf81b 100644 > --- a/plug-ins/script-fu/scheme-wrapper.c > +++ b/plug-ins/script-fu/scheme-wrapper.c > @@ -329,6 +329,7 @@ ts_stdout_output_func (TsOutputType type, > if (len < 0) > len = strlen (string); > fprintf (stdout, "%.*s", len, string); > + fflush (stdout); > } > > void > ___ > Gimp-developer mailing list > Gimp-developer@lists.XCF.Berkeley.EDU > https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer > ___ Gimp-developer mailing list Gimp-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
Re: [Gimp-developer] [PATCH] fix to batch console support
Sven Neumann wrote: > Please merge this to the gimp-2-6 branch also. > > Sven > There we go: commit 3c59c936e075a36d1648cbf38ae12c2577432f74 Author: Christopher Montgomery Date: Thu May 28 21:06:53 2009 +0200 plug-ins: Make sure to flush output in ts_stdout_output_func() / Martin ___ Gimp-developer mailing list Gimp-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
Re: [Gimp-developer] [PATCH] fix to batch console support
Hi, On Thu, 2009-05-28 at 21:08 +0200, Martin Nordholts wrote: > Christopher Montgomery wrote: > > The batch mode console is using stdio but never flushing its output > > after fwrite()s. This still usually works by accident when using > > batch mode from a terminal, but it means scripts generally won't work > > as responses to requests never get flushed through the return pipe. > > Seems like a reasonable patch to me, I pushed to GNOME master: > > commit 7b7d44837834061e8ee2c668b0f9d99d9ae13dcf > Author: Christopher Montgomery > Date: Thu May 28 21:06:53 2009 +0200 > > plug-ins: Make sure to flush output in ts_stdout_output_func() Please merge this to the gimp-2-6 branch also. Sven ___ Gimp-developer mailing list Gimp-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
Re: [Gimp-developer] [PATCH] fix to batch console support
Christopher Montgomery wrote: > The batch mode console is using stdio but never flushing its output > after fwrite()s. This still usually works by accident when using > batch mode from a terminal, but it means scripts generally won't work > as responses to requests never get flushed through the return pipe. Seems like a reasonable patch to me, I pushed to GNOME master: commit 7b7d44837834061e8ee2c668b0f9d99d9ae13dcf Author: Christopher Montgomery Date: Thu May 28 21:06:53 2009 +0200 plug-ins: Make sure to flush output in ts_stdout_output_func() / Martin ___ Gimp-developer mailing list Gimp-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
[Gimp-developer] [PATCH] fix to batch console support
The batch mode console is using stdio but never flushing its output after fwrite()s. This still usually works by accident when using batch mode from a terminal, but it means scripts generally won't work as responses to requests never get flushed through the return pipe. Apologies for this not being in git format-patch format, it was a spot test to get other unit tests working and trivial enough it doesn't seem worth the extra trouble. Cheers, Monty diff --git a/plug-ins/script-fu/scheme-wrapper.c b/plug-ins/script-fu/scheme-wrapper.c index 9212801..fbcf81b 100644 --- a/plug-ins/script-fu/scheme-wrapper.c +++ b/plug-ins/script-fu/scheme-wrapper.c @@ -329,6 +329,7 @@ ts_stdout_output_func (TsOutputType type, if (len < 0) len = strlen (string); fprintf (stdout, "%.*s", len, string); + fflush (stdout); } void ___ Gimp-developer mailing list Gimp-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer