summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-05-07 14:46:33 +0000
committerJim Meyering <jim@meyering.net>2000-05-07 14:46:33 +0000
commit72bdac727100dd893ad1041cb9a06b48fa211058 (patch)
tree8eaf75b31d328c20dcc50e79e2b124c552a0ee62
parentf1013a15356cd77518af435233564f0ba7b7c099 (diff)
downloadcoreutils-72bdac727100dd893ad1041cb9a06b48fa211058.tar.xz
Include "closeout.h".
(main): Call atexit with close_stdout.
-rw-r--r--src/test.c5
-rw-r--r--src/uname.c5
-rw-r--r--src/uptime.c3
-rw-r--r--src/users.c3
-rw-r--r--src/who.c3
-rw-r--r--src/whoami.c5
6 files changed, 21 insertions, 3 deletions
diff --git a/src/test.c b/src/test.c
index d3737f93e..8b5f7a8a7 100644
--- a/src/test.c
+++ b/src/test.c
@@ -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;
diff --git a/src/uname.c b/src/uname.c
index f199ad065..a6ffe508b 100644
--- a/src/uname.c
+++ b/src/uname.c
@@ -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)
diff --git a/src/uptime.c b/src/uptime.c
index 084831fa7..eec73771a 100644
--- a/src/uptime.c
+++ b/src/uptime.c
@@ -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);
diff --git a/src/users.c b/src/users.c
index 43fe68056..9a6d277d0 100644
--- a/src/users.c
+++ b/src/users.c
@@ -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);
diff --git a/src/who.c b/src/who.c
index db175a623..a937365e1 100644
--- 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)
{
diff --git a/src/whoami.c b/src/whoami.c
index e5fd7183f..1279b5975 100644
--- a/src/whoami.c
+++ b/src/whoami.c
@@ -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);