fix fopen handle leak, static build

git-svn-id: svn://kolibrios.org@6744 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
siemargl 2016-11-23 11:13:09 +00:00
parent 09d8656eef
commit 2af7a3394b
3 changed files with 11 additions and 4 deletions

View File

@ -553,6 +553,7 @@ ifeq ($(findstring static,$(MAKECMDGOALS)),static)
LIB_SRCS:= $(STATIC_SRCS) LIB_SRCS:= $(STATIC_SRCS)
LIB_OBJS:= $(STATIC_OBJS) LIB_OBJS:= $(STATIC_OBJS)
CFLAGS += -DSTATIC_LIBC
else else
@ -667,6 +668,9 @@ time/wcsftime.o: time/strftime.c
%.o : %.c Makefile %.o : %.c Makefile
$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -o $@ $< $(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -o $@ $<
%.o : %.S Makefile
$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -o $@ $<
clean: clean:
-rm -f */*.o -rm -f */*.o

View File

@ -115,6 +115,7 @@ int open (const char * filename, int flags, ...)
if(hid < 0) if(hid < 0)
{ {
errno = EMFILE; errno = EMFILE;
__io_free(hid);
return (-1); return (-1);
}; };
@ -136,6 +137,7 @@ int open (const char * filename, int flags, ...)
if( !err ) if( !err )
{ {
errno = EEXIST; errno = EEXIST;
__io_free(hid);
return (-1); return (-1);
}; };
} }
@ -147,6 +149,7 @@ int open (const char * filename, int flags, ...)
if( err ) if( err )
{ {
errno = EACCES; errno = EACCES;
__io_free(hid);
return -1; return -1;
}; };
}; };

View File

@ -9,7 +9,7 @@ SECTIONS
LONG(0x554e454D); LONG(0x554e454D);
LONG(0x32305445); LONG(0x32305445);
LONG(1); LONG(1);
LONG(__start); LONG(__crt_start);
LONG(___iend); LONG(___iend);
LONG(___memsize); LONG(___memsize);
LONG(___stacktop); LONG(___stacktop);