summaryrefslogtreecommitdiffstats
path: root/text-utils/pg.c
diff options
context:
space:
mode:
authorSami Kerola2012-04-04 19:39:15 +0200
committerSami Kerola2012-04-04 19:45:41 +0200
commitb87cbe8486a2799a137c8100afaa05b352bb0ccf (patch)
treec8e0653333e146b91460e74c3902652c5eb9e024 /text-utils/pg.c
parentinclude: add stream error checking facility (diff)
downloadkernel-qcow2-util-linux-b87cbe8486a2799a137c8100afaa05b352bb0ccf.tar.gz
kernel-qcow2-util-linux-b87cbe8486a2799a137c8100afaa05b352bb0ccf.tar.xz
kernel-qcow2-util-linux-b87cbe8486a2799a137c8100afaa05b352bb0ccf.zip
text-utils: verify writing to streams was successful
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'text-utils/pg.c')
-rw-r--r--text-utils/pg.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/text-utils/pg.c b/text-utils/pg.c
index b61b1504f..2b5144252 100644
--- a/text-utils/pg.c
+++ b/text-utils/pg.c
@@ -63,6 +63,7 @@
#include "xalloc.h"
#include "widechar.h"
#include "writeall.h"
+#include "closestream.h"
#define READBUF LINE_MAX /* size of input buffer */
#define CMDBUF 255 /* size of command buffer */
@@ -1594,6 +1595,7 @@ main(int argc, char **argv)
setlocale(LC_MESSAGES, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
if (tcgetattr(1, &otio) == 0) {
ontty = 1;