aboutsummaryrefslogtreecommitdiffhomepage
path: root/main.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2025-10-23 11:18:54 +0200
committerlemon <lsof@mailbox.org>2025-10-23 11:18:54 +0200
commit0a51f5b8d9b3d98225382277a176fa85ccdb5ab8 (patch)
treed4d4fa38c04db077bac14137f965d51385f87b6a /main.c
parentcb199f47ca31b079212fe4fd3987e5ba39b12273 (diff)
use libc's stdout/stderr; also eliminate some unnecessary recursion in bfmt
Diffstat (limited to 'main.c')
-rw-r--r--main.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/main.c b/main.c
index 9449d85..575cf46 100644
--- a/main.c
+++ b/main.c
@@ -9,13 +9,6 @@
struct option ccopt;
struct inclpaths *cinclpaths;
-static void
-flushstd(void)
-{
- ioflush(&bstdout);
- ioflush(&bstderr);
-}
-
/* parse an argument of the form 'opt=abcd'
* e.g. arg="foo=bar123"; opt="foo"; returns "bar123" */
static const char *
@@ -236,7 +229,6 @@ compileobjs(void)
if (!ccopt.dbg.any) mktemps();
for (int i = 0; i < task.ninf; ++i) {
- flushstd();
if ((p = fork()) < 0) {
error(NULL, "fork(): %s\n", strerror(errno));
exit(1);
@@ -284,7 +276,6 @@ dolink(void)
efmt("\n");
}
vpush(&cmd, NULL);
- flushstd();
if ((p = fork()) < 0) {
error(NULL, "fork(): %s\n", strerror(errno));
exit(1);
@@ -410,9 +401,9 @@ sysinclpaths(void)
int
main(int argc, char **argv)
{
- atexit(flushstd);
globarena->cap = sizeof(_arenamem.mem) - sizeof(struct arena);
+ ioinit();
/* setup defaults */
detectcolor();
sysinclpaths();