help-gsasl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: stream buffering problems in batch mode


From: Simon Josefsson
Subject: Re: stream buffering problems in batch mode
Date: Mon, 03 Mar 2008 15:16:13 +0100
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1 (gnu/linux)

Enrico Scholz <address@hidden> writes:

> Simon Josefsson <address@hidden> writes:
>
>> Hello Enrico!  Thanks for the report and patch.  I'd rather not touch
>> stderr buffering if not necessary (it is unbuffered, not even line
>> buffered, by default), what do you think of using the following patch
>> instead?  Does it work for you?
>
> yes; it works.

I have installed the patch.  Thanks for confirming.

/Simon
>From 46ae278cd942e5c2f50147730b056712c7438edf Mon Sep 17 00:00:00 2001
From: Simon Josefsson <address@hidden>
Date: Mon, 3 Mar 2008 15:13:44 +0100
Subject: [PATCH] Make stdout line buffered, to avoid buffering problems.
 Reported by Enrico Scholz <address@hidden>, see
 <http://thread.gmane.org/gmane.comp.gnu.gsasl.general/123>.

---
 NEWS        |    6 ++++++
 THANKS      |    1 +
 src/gsasl.c |    3 +++
 3 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/NEWS b/NEWS
index 572805d..ecb173a 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,12 @@ SASL.  That include the manual, the command line tool, and 
self tests.
 
 * Version 0.2.25 (unreleased)
 
+** gsasl: Fix buffering issue to avoid mixing stdout/stderr outputs.
+This would manifest itself when redirecting output to a pipe, such as
+when used with Gnus.  Reported by Enrico Scholz
+<address@hidden>, see
+<http://thread.gmane.org/gmane.comp.gnu.gsasl.general/123>.
+
 ** Fix non-portable use of brace expansion in makefiles.
 
 * Version 0.2.24 (released 2008-01-15)
diff --git a/THANKS b/THANKS
index 2cfac83..10d4d85 100644
--- a/THANKS
+++ b/THANKS
@@ -31,6 +31,7 @@ Maxim Britov
 Brad Hards
 James Canete
 Daniel Armyr
+Enrico Scholz
 
 ----------------------------------------------------------------------
 Copying and distribution of this file, with or without modification,
diff --git a/src/gsasl.c b/src/gsasl.c
index 5e9df8d..11bdb9d 100644
--- a/src/gsasl.c
+++ b/src/gsasl.c
@@ -410,6 +410,9 @@ main (int argc, char *argv[])
   if (connect_hostname && !args_info.hostname_arg)
     args_info.hostname_arg = strdup (connect_hostname);
 
+  if (!isatty (STDOUT_FILENO))
+    setvbuf (stdout, NULL, _IOLBF, BUFSIZ);
+
   res = gsasl_init (&ctx);
   if (res != GSASL_OK)
     error (EXIT_FAILURE, 0, _("initialization failure: %s"),
-- 
1.5.4.1


reply via email to

[Prev in Thread] Current Thread [Next in Thread]