Skip to content

Commit e7db5b6

Browse files
andrea-adamimthuurne
authored andcommitted
mininit.c: klibc specific fix around missing setlinebuf
Klibc has buffered I/O since v. 2.0 but still lacks some streeam functions. Fixing: | mininit.o: In function `main': | mininit.c:(.text.startup+0x70): undefined reference to `setlinebuf' Signed-off-by: Andrea Adami <[email protected]>
1 parent a01fcaf commit e7db5b6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

mininit.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ int main(int argc, char **argv, char **envp)
106106
/* Write our log messages to the kernel log. */
107107
FILE *kmsg = fopen("/dev/kmsg", "w");
108108
if (kmsg) {
109+
#ifndef __KLIBC__
109110
setlinebuf(kmsg);
111+
#endif /* __KLIBC__ */
110112
logfile = kmsg;
111113
}
112114
INFO("OpenDingux mininit 2.0.1\n");

0 commit comments

Comments
 (0)