bug-sourceinstall
[Top][All Lists]
Advanced

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

[bug-sourceinstall] patch for sourceinstaller


From: Brian Gough
Subject: [bug-sourceinstall] patch for sourceinstaller
Date: Sun, 29 Nov 2009 21:39:51 +0000
User-agent: Wanderlust/2.14.0 (Africa) Emacs/22.2 Mule/5.0 (SAKAKI)

Hello.  I've been testing a lot of packages and found that the stderr and
stdout output from the sourceinstall command-line tool can get mixed
up if they are redirected to a file -- I think they need to be
line-buffered.

The patch below avoids the problem -- not sure if sourceinstall.c is
the best place for it though, maybe it should go in libsrcinstall?

Index: sourceinstall.c
===================================================================
RCS file: /sources/sourceinstall/sourceinstall2/sourceinstall/sourceinstall.c,v
retrieving revision 1.30
diff -u -r1.30 sourceinstall.c
--- sourceinstall.c     8 Dec 2007 21:21:00 -0000       1.30
+++ sourceinstall.c     29 Nov 2009 21:27:26 -0000
@@ -1094,6 +1094,10 @@
     textdomain(PACKAGE);
 #endif /* ENABLE_NLS */
 
+    /* Make output line-buffered */
+    setvbuf(stdout, (char *)NULL, _IOLBF, 0);
+    setvbuf(stderr, (char *)NULL, _IOLBF, 0);
+
     if (!srcinst_init(SRCINST_FLAG_LOAD_ONDEMAND)) {
        srcinst_error(SRCINST_ERR_CORE, _("could not initialize libsrcinst"),
                      0);




reply via email to

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