summaryrefslogtreecommitdiffstats
path: root/src/mkid.c
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2008-05-20 10:15:46 +0200
committerJim Meyering <meyering@redhat.com>2008-05-20 10:15:46 +0200
commitb47e28bbc861470014de386fc116335f29de0656 (patch)
tree4681a660ed31a4c8be0dc6d550709be000e237e4 /src/mkid.c
parentff2a80bc177f3cd673d3f133f543c011f01748ae (diff)
downloadidutils-b47e28bbc861470014de386fc116335f29de0656.tar.gz
idutils-b47e28bbc861470014de386fc116335f29de0656.tar.bz2
idutils-b47e28bbc861470014de386fc116335f29de0656.zip
detect write error on stdout
* src/fid.c: Include "closeout.h". (main): Use it via atexit. * src/fnid.c (main): Likewise. * src/lid.c (main): Likewise. * src/mkid.c (main): Likewise. * src/xtokid.c (main): Likewise. * NEWS: Mention the bug fixes.
Diffstat (limited to 'src/mkid.c')
-rw-r--r--src/mkid.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mkid.c b/src/mkid.c
index fdf9926..c0528cb 100644
--- a/src/mkid.c
+++ b/src/mkid.c
@@ -34,6 +34,7 @@
#include <xalloc.h>
#include <error.h>
+#include "closeout.h"
#include "xnls.h"
#include "idfile.h"
#include "hash.h"
@@ -59,7 +60,6 @@ struct summary
void usage (void);
static void help_me (void);
-int main (int argc, char **argv);
static int ceil_log_8 (unsigned long n);
static int ceil_log_2 (unsigned long n);
static void assert_writeable (char const *file_name);
@@ -209,6 +209,8 @@ main (int argc, char **argv)
textdomain (PACKAGE);
#endif
+ atexit (close_stdout);
+
for (;;)
{
int optc = getopt_long (argc, argv, "o:f:i:x:l:m:d:p:vVs",