]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Include "closeout.h".
authorJim Meyering <jim@meyering.net>
Sun, 7 May 2000 14:55:15 +0000 (14:55 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 7 May 2000 14:55:15 +0000 (14:55 +0000)
(main): Call atexit with close_stdout.

src/logname.c
src/nice.c
src/pathchk.c

index 9633b2e2fa344c387f5ba03622bffab19aaf49be..a505791d57fca8c80f8343e039c663424d9d94f8 100644 (file)
@@ -68,6 +68,8 @@ main (int argc, char **argv)
   bindtextdomain (PACKAGE, LOCALEDIR);
   textdomain (PACKAGE);
 
+  atexit (close_stdout);
+
   parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION,
                      AUTHORS, usage);
 
@@ -91,7 +93,6 @@ main (int argc, char **argv)
   if (cp)
     {
       puts (cp);
-      close_stdout ();
       exit (0);
     }
   /* POSIX.2 prohibits using a fallback technique.  */
index 3bca81e480f955176db75e5b6e42c807b0b0a05b..1fbcd9046b9b77a5930bf549b2fe99cf2f4e9a6f 100644 (file)
@@ -1,5 +1,5 @@
 /* nice -- run a program with modified scheduling priority
-   Copyright (C) 1990-1999 Free Software Foundation, Inc.
+   Copyright (C) 1990-2000 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -33,6 +33,7 @@
 #include "error.h"
 #include "long-options.h"
 #include "xstrtol.h"
+#include "closeout.h"
 
 /* The official name of this program (e.g., no `g' prefix).  */
 #define PROGRAM_NAME "nice"
@@ -91,6 +92,8 @@ main (int argc, char **argv)
   bindtextdomain (PACKAGE, LOCALEDIR);
   textdomain (PACKAGE);
 
+  atexit (close_stdout);
+
   parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION,
                      AUTHORS, usage);
 
index 97f2fb9d6c3b71a291e701c2fb075dec91b0c65a..74241588ad215cd1a04525b6dd90c2bee9becca8 100644 (file)
@@ -1,5 +1,5 @@
 /* pathchk -- check whether pathnames are valid or portable
-   Copyright (C) 1991-1999 Free Software Foundation, Inc.
+   Copyright (C) 1991-2000 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -46,6 +46,7 @@
 #include "system.h"
 #include "error.h"
 #include "long-options.h"
+#include "closeout.h"
 
 /* The official name of this program (e.g., no `g' prefix).  */
 #define PROGRAM_NAME "pathchk"
@@ -139,6 +140,8 @@ main (int argc, char **argv)
   bindtextdomain (PACKAGE, LOCALEDIR);
   textdomain (PACKAGE);
 
+  atexit (close_stdout);
+
   parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION,
                      AUTHORS, usage);