aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2015-01-03 16:25:36 -0600
committerRob Landley <rob@landley.net>2015-01-03 16:25:36 -0600
commitaad492fd87d689c443e87561c23abc2e12b785a9 (patch)
tree6b3f91834fecc081f0aaffd1e3d3a2e6d90fafcd /main.c
parent87fd25f20b86731dd01332ce828424e7047ef29d (diff)
downloadtoybox-aad492fd87d689c443e87561c23abc2e12b785a9.tar.gz
Move fflush() checking to xexit() and have exit paths in main() call that.
Diffstat (limited to 'main.c')
-rw-r--r--main.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/main.c b/main.c
index dfab2f2a..6ca6c2d9 100644
--- a/main.c
+++ b/main.c
@@ -136,7 +136,6 @@ void toy_exec(char *argv[])
// Run command
toy_init(which, argv);
if (toys.which) toys.which->toy_main();
- if (fflush(NULL) || ferror(stdout)) perror_exit("write");
xexit();
}
@@ -189,8 +188,7 @@ int main(int argc, char *argv[])
// a single toybox command built standalone with no multiplexer
toy_singleinit(toy_list, argv);
toy_list->toy_main();
- if (fflush(NULL) || ferror(stdout)) perror_exit("write");
}
- return toys.exitval;
+ xexit();
}