]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
schedutils: verify writing to streams was successful
authorSami Kerola <kerolasa@iki.fi>
Wed, 4 Apr 2012 17:51:32 +0000 (19:51 +0200)
committerSami Kerola <kerolasa@iki.fi>
Wed, 4 Apr 2012 17:51:32 +0000 (19:51 +0200)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
schedutils/chrt.c
schedutils/ionice.c
schedutils/taskset.c

index 944cd77486f3d4924b3a8b44d3868e8c3edcde7a..cbf2417e89806cdf423752c1f15824d7bbac50b5 100644 (file)
@@ -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)
        {
index 18529753f4ffc35c8be724a5e4a46a2c9d181766..5fdeccf8defe733ab6f22db0bb41e4c5257d40f0 100644 (file)
@@ -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) {
index b7aee5064dcf31627961c705bfe6db220841f0d2..908ac8e2d8535902085a12ebd7f1f06db08bf723 100644 (file)
@@ -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));