]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - sys-utils/pivot_root.c
sys-utils: verify writing to streams was successful
[thirdparty/util-linux.git] / sys-utils / pivot_root.c
index 044aab22671ebd482c8e6c4cd3a0405ee978a4e3..31ceabb787c69b743b6081e34b48cdcffe98d5ef 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "c.h"
 #include "nls.h"
+#include "closestream.h"
 
 #define pivot_root(new_root,put_old) syscall(SYS_pivot_root,new_root,put_old)
 
@@ -50,6 +51,7 @@ int main(int argc, char **argv)
        setlocale(LC_ALL, "");
        bindtextdomain(PACKAGE, LOCALEDIR);
        textdomain(PACKAGE);
+       atexit(close_stdout);
 
        while ((ch = getopt_long(argc, argv, "Vh", longopts, NULL)) != -1)
                switch (ch) {