summaryrefslogtreecommitdiffstats
path: root/src
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
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')
-rw-r--r--src/fid.c3
-rw-r--r--src/fnid.c3
-rw-r--r--src/lid.c3
-rw-r--r--src/mkid.c4
-rw-r--r--src/xtokid.c3
5 files changed, 15 insertions, 1 deletions
diff --git a/src/fid.c b/src/fid.c
index 45c6853..05130fd 100644
--- a/src/fid.c
+++ b/src/fid.c
@@ -28,6 +28,7 @@
#include <pathmax.h>
#include <xalloc.h>
+#include "closeout.h"
#include "xnls.h"
#include "idfile.h"
#include "iduglobal.h"
@@ -113,6 +114,8 @@ main (int argc, char **argv)
textdomain (PACKAGE);
#endif
+ atexit (close_stdout);
+
for (;;)
{
int optc = getopt_long (argc, argv, "f:",
diff --git a/src/fnid.c b/src/fnid.c
index d20c543..6a81189 100644
--- a/src/fnid.c
+++ b/src/fnid.c
@@ -29,6 +29,7 @@
#include <pathmax.h>
#include <error.h>
+#include "closeout.h"
#include "xnls.h"
#include "idfile.h"
#include "iduglobal.h"
@@ -97,6 +98,8 @@ main (int argc, char **argv)
textdomain (PACKAGE);
#endif
+ atexit (close_stdout);
+
for (;;)
{
int optc = getopt_long (argc, argv, "f:S:",
diff --git a/src/lid.c b/src/lid.c
index d7c3770..2ea305c 100644
--- a/src/lid.c
+++ b/src/lid.c
@@ -38,6 +38,7 @@
#include <pathmax.h>
#include <error.h>
+#include "closeout.h"
#include "xnls.h"
#include "idfile.h"
#include "iduglobal.h"
@@ -304,6 +305,8 @@ main (int argc, char **argv)
textdomain (PACKAGE);
#endif
+ atexit (close_stdout);
+
for (;;)
{
int optc = getopt_long (argc, argv, "f:F:a:k:R:S:ilrwsxdo",
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",
diff --git a/src/xtokid.c b/src/xtokid.c
index 5dc97fe..3ee8e92 100644
--- a/src/xtokid.c
+++ b/src/xtokid.c
@@ -26,6 +26,7 @@
#include <pathmax.h>
#include <error.h>
+#include "closeout.h"
#include "xnls.h"
#include "scanners.h"
#include "idfile.h"
@@ -102,6 +103,8 @@ main (int argc, char **argv)
textdomain (PACKAGE);
#endif
+ atexit (close_stdout);
+
for (;;)
{
int optc = getopt_long (argc, argv, "i:x:l:m:d:p:",