RSS/Atom feed Twitter
Site is read-only, email is disabled

[PATCH] fix to batch console support

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

5 of 5 messages available
Toggle history

Please log in to manage your subscriptions.

[PATCH] fix to batch console support Christopher Montgomery 28 May 20:37
  [PATCH] fix to batch console support Martin Nordholts 28 May 21:07
   [PATCH] fix to batch console support Sven Neumann 28 May 21:19
    [PATCH] fix to batch console support Martin Nordholts 28 May 21:32
  [PATCH] fix to batch console support Esteban Barahona 29 May 04:42
Christopher Montgomery
2009-05-28 20:37:27 UTC (over 15 years ago)

[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

Martin Nordholts
2009-05-28 21:07:51 UTC (over 15 years ago)

[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

Sven Neumann
2009-05-28 21:19:40 UTC (over 15 years ago)

[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

Martin Nordholts
2009-05-28 21:32:43 UTC (over 15 years ago)

[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

Esteban Barahona
2009-05-29 04:42:07 UTC (over 15 years ago)

[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