]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - term-utils/mesg.c
term-utils: verify writing to streams was successful
[thirdparty/util-linux.git] / term-utils / mesg.c
index 4fad6f57a1d571a049555c5838a31e98c36d70f3..366c679acd684acfab28afcf207bfb18b544d53e 100644 (file)
@@ -54,6 +54,8 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <getopt.h>
+
+#include "closestream.h"
 #include "nls.h"
 #include "c.h"
 
@@ -88,6 +90,7 @@ int main(int argc, char *argv[])
        setlocale(LC_ALL, "");
        bindtextdomain(PACKAGE, LOCALEDIR);
        textdomain(PACKAGE);
+       atexit(close_stdout);
 
        static const struct option longopts[] = {
                { "verbose",    no_argument,       0, 'v' },