From: Sami Kerola Date: Wed, 4 Apr 2012 17:51:32 +0000 (+0200) Subject: schedutils: verify writing to streams was successful X-Git-Tag: v2.22-rc1~539^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed8ec2a65d468b638d865d6fdafe0a249ca74c91;p=thirdparty%2Futil-linux.git schedutils: verify writing to streams was successful Signed-off-by: Sami Kerola --- diff --git a/schedutils/chrt.c b/schedutils/chrt.c index 944cd77486..cbf2417e89 100644 --- a/schedutils/chrt.c +++ b/schedutils/chrt.c @@ -31,7 +31,7 @@ #include "c.h" #include "nls.h" - +#include "closestream.h" #include "strutils.h" #include "procutils.h" @@ -218,6 +218,7 @@ int main(int argc, char **argv) setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); + atexit(close_stdout); while((i = getopt_long(argc, argv, "+abfiphmoRrvV", longopts, NULL)) != -1) { diff --git a/schedutils/ionice.c b/schedutils/ionice.c index 18529753f4..5fdeccf8de 100644 --- a/schedutils/ionice.c +++ b/schedutils/ionice.c @@ -17,6 +17,7 @@ #include "nls.h" #include "strutils.h" #include "c.h" +#include "closestream.h" static int tolerant; @@ -139,6 +140,7 @@ int main(int argc, char **argv) setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); + atexit(close_stdout); while ((c = getopt_long(argc, argv, "+n:c:p:tVh", longopts, NULL)) != EOF) switch (c) { diff --git a/schedutils/taskset.c b/schedutils/taskset.c index b7aee5064d..908ac8e2d8 100644 --- a/schedutils/taskset.c +++ b/schedutils/taskset.c @@ -34,6 +34,7 @@ #include "xalloc.h" #include "procutils.h" #include "c.h" +#include "closestream.h" struct taskset { pid_t pid; /* task PID */ @@ -146,6 +147,7 @@ int main(int argc, char **argv) setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); + atexit(close_stdout); memset(&ts, 0, sizeof(ts));