Usermode/libc - Fix not loading crt0.s in libc
authorJohn Hodge (sonata) <[email protected]>
Mon, 3 Nov 2014 04:40:05 +0000 (12:40 +0800)
committerJohn Hodge (sonata) <[email protected]>
Mon, 3 Nov 2014 04:40:05 +0000 (12:40 +0800)
Usermode/Libraries/libc.so_src/Makefile
Usermode/Libraries/libc.so_src/stdio.c

index 4dc43e1..40977e9 100644 (file)
@@ -7,7 +7,7 @@ CPPFLAGS +=
 CFLAGS   += -nostdlib -Wall -Werror -Wextra\r
 ASFLAGS  +=\r
 LDFLAGS  += -nostdlib\r
-PRELINK  := $(CRTI) $(CRTBEGINS) $(CRTS)\r
+PRELINK  := $(CRTI) $(CRTBEGINS) $(CRT0S)\r
 LIBS     += $(LIBGCC_PATH) $(CRTENDS) $(CRTN)\r
 \r
 INCFILES := stdio.h stdlib.h\r
index a0008d3..cf2e733 100644 (file)
@@ -692,6 +692,10 @@ EXPORT size_t fread(void *ptr, size_t size, size_t num, FILE *fp)
        if( _GetFileMode(fp) != FILE_FLAG_MODE_READ ) {\r
                errno = 0;\r
                LOG_WARN("not open for read");\r
+               if( fp == stdin ) {\r
+                       LOG_WARN("BUGCHECK FAIL: stdin was not open for read");\r
+                       exit(129);\r
+               }\r
                return -1;\r
        }\r
 \r

UCC git Repository :: git.ucc.asn.au