[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-sourceinstall] Re: patch for sourceinstaller
From: |
Claudio Fontana |
Subject: |
[bug-sourceinstall] Re: patch for sourceinstaller |
Date: |
Tue, 1 Dec 2009 00:09:50 +0100 |
On Sun, Nov 29, 2009 at 10:39 PM, Brian Gough <address@hidden> wrote:
> 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?
I think so, yes. libsrcinst would be the place to do it, so that for example
sourceinstall-gtk can profit from the change as well.
> 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);
>