Include "closeout.h".
authorJim Meyering <jim@meyering.net>
Sun, 7 May 2000 14:46:33 +0000 (14:46 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 7 May 2000 14:46:33 +0000 (14:46 +0000)
(main): Call atexit with close_stdout.

src/test.c
src/uname.c
src/uptime.c
src/users.c
src/who.c
src/whoami.c

index d3737f9..8b5f7a8 100644 (file)
@@ -2,7 +2,7 @@
 
 /* Modified to run with the GNU shell by bfox. */
 
-/* Copyright (C) 1987-1999 Free Software Foundation, Inc.
+/* Copyright (C) 1987-2000 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -973,6 +973,7 @@ posixtest (void)
 
 #if defined (TEST_STANDALONE)
 # include "long-options.h"
+# include "closeout.h"
 
 void
 usage (int status)
@@ -1080,6 +1081,8 @@ main (int margc, char **margv)
   setlocale (LC_ALL, "");
   bindtextdomain (PACKAGE, LOCALEDIR);
   textdomain (PACKAGE);
+
+  atexit (close_stdout);
 #endif /* TEST_STANDALONE */
 
   argv = margv;
index f199ad0..a6ffe50 100644 (file)
@@ -1,5 +1,5 @@
 /* uname -- print system information
-   Copyright (C) 1989-1999 Free Software Foundation, Inc.
+   Copyright (C) 1989-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
@@ -40,6 +40,7 @@
 
 #include "system.h"
 #include "error.h"
+#include "closeout.h"
 
 /* The official name of this program (e.g., no `g' prefix).  */
 #define PROGRAM_NAME "uname"
@@ -124,6 +125,8 @@ main (int argc, char **argv)
   bindtextdomain (PACKAGE, LOCALEDIR);
   textdomain (PACKAGE);
 
+  atexit (close_stdout);
+
   toprint = 0;
 
   while ((c = getopt_long (argc, argv, "snrvpma", long_options, NULL)) != -1)
index 084831f..eec7377 100644 (file)
@@ -25,6 +25,7 @@
 #include "long-options.h"
 #include "readutmp.h"
 #include "system.h"
+#include "closeout.h"
 
 /* The official name of this program (e.g., no `g' prefix).  */
 #define PROGRAM_NAME "uptime"
@@ -192,6 +193,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 43fe680..9a6d277 100644 (file)
@@ -25,6 +25,7 @@
 #include "long-options.h"
 #include "readutmp.h"
 #include "system.h"
+#include "closeout.h"
 
 /* The official name of this program (e.g., no `g' prefix).  */
 #define PROGRAM_NAME "users"
@@ -134,6 +135,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 db175a6..a937365 100644 (file)
--- a/src/who.c
+++ b/src/who.c
@@ -31,6 +31,7 @@
 #include "error.h"
 #include "readutmp.h"
 #include "system.h"
+#include "closeout.h"
 
 /* The official name of this program (e.g., no `g' prefix).  */
 #define PROGRAM_NAME "who"
@@ -392,6 +393,8 @@ main (int argc, char **argv)
   bindtextdomain (PACKAGE, LOCALEDIR);
   textdomain (PACKAGE);
 
+  atexit (close_stdout);
+
   while ((optc = getopt_long (argc, argv, "ilmqsuwHT", longopts, &longind))
         != -1)
     {
index e5fd718..1279b59 100644 (file)
@@ -1,5 +1,5 @@
 /* whoami -- print effective userid
-   Copyright (C) 89,90, 1991-1997, 1999 Free Software Foundation, Inc.
+   Copyright (C) 89,90, 1991-1997, 1999, 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
@@ -26,6 +26,7 @@
 
 #include "system.h"
 #include "long-options.h"
+#include "closeout.h"
 
 /* The official name of this program (e.g., no `g' prefix).  */
 #define PROGRAM_NAME "whoami"
@@ -72,6 +73,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);