From efb8854f4cfa335f3ad72d79a84589110c2a8e87 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Wed, 4 Apr 2012 19:49:40 +0200 Subject: sys-utils: verify writing to streams was successful Signed-off-by: Sami Kerola --- sys-utils/switch_root.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sys-utils/switch_root.c') diff --git a/sys-utils/switch_root.c b/sys-utils/switch_root.c index 0da784295..4ff3bff8f 100644 --- a/sys-utils/switch_root.c +++ b/sys-utils/switch_root.c @@ -35,6 +35,7 @@ #include "c.h" #include "nls.h" +#include "closestream.h" #ifndef MS_MOVE #define MS_MOVE 8192 @@ -194,6 +195,7 @@ static void __attribute__((__noreturn__)) usage(FILE *output) int main(int argc, char *argv[]) { char *newroot, *init, **initargs; + atexit(close_stdout); if (argv[1] && (!strcmp(argv[1], "--help") || !strcmp(argv[1], "-h"))) usage(stdout); -- cgit v1.2.3-55-g7522