From: Jim Meyering Date: Sun, 7 May 2000 14:46:33 +0000 (+0000) Subject: Include "closeout.h". X-Git-Tag: SH-UTILS-2_0h~22 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=72bdac727100dd893ad1041cb9a06b48fa211058;p=thirdparty%2Fcoreutils.git Include "closeout.h". (main): Call atexit with close_stdout. --- diff --git a/src/test.c b/src/test.c index d3737f93e8..8b5f7a8a76 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 f199ad0656..a6ffe508b5 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 084831fa7a..eec73771a6 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 43fe68056b..9a6d277d0b 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 db175a623f..a937365e12 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 e5fd7183f4..1279b5975e 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);