This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch master
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=473cbd6a163eb685ec1fbd5301224c2964d7efb4

commit 473cbd6a163eb685ec1fbd5301224c2964d7efb4
Author: Guillem Jover <[email protected]>
AuthorDate: Wed Oct 3 04:37:35 2018 +0200

    libdpkg: Set stdout to be fully buffered when using a pager
    
    Force the output to fully buffered, because originally stdout was
    a tty, so it was set as line buffered. This way we send as much as
    possible to the pager, which will handle the output by itself.
---
 debian/changelog | 1 +
 lib/dpkg/pager.c | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 359d23f6b..616491dfb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -13,6 +13,7 @@ dpkg (1.19.2) UNRELEASED; urgency=medium
   * libdpkg: Ignore SIGPIPE when setting up a pager, and then ignore EPIPE
     errors when writing to stdout, otherwise if we quit the pager early, the
     program will exit with an error code.
+  * libdpkg: Set stdout to be fully buffered when using a pager.
   * Perl modules:
     - Dpkg::OpenPGP: Ignore Version field in enarmored output.
       Fixes CPAN#127217.
diff --git a/lib/dpkg/pager.c b/lib/dpkg/pager.c
index ed41daedb..b2dad68b4 100644
--- a/lib/dpkg/pager.c
+++ b/lib/dpkg/pager.c
@@ -110,6 +110,11 @@ pager_spawn(const char *desc)
        close(pager->pipe[0]);
        close(pager->pipe[1]);
 
+       /* Force the output to fully buffered, because originally stdout was
+        * a tty, so it was set as line buffered. This way we send as much as
+        * possible to the pager, which will handle the output by itself. */
+       setvbuf(stdout, NULL, _IOFBF, 0);
+
        return pager;
 }
 

-- 
Dpkg.Org's dpkg

Reply via email to