diff options
author | Jim Meyering <meyering@redhat.com> | 2008-05-20 10:15:46 +0200 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2008-05-20 10:15:46 +0200 |
commit | b47e28bbc861470014de386fc116335f29de0656 (patch) | |
tree | 4681a660ed31a4c8be0dc6d550709be000e237e4 /src | |
parent | ff2a80bc177f3cd673d3f133f543c011f01748ae (diff) | |
download | idutils-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.c | 3 | ||||
-rw-r--r-- | src/fnid.c | 3 | ||||
-rw-r--r-- | src/lid.c | 3 | ||||
-rw-r--r-- | src/mkid.c | 4 | ||||
-rw-r--r-- | src/xtokid.c | 3 |
5 files changed, 15 insertions, 1 deletions
@@ -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:", @@ -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:", @@ -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", @@ -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:", |