From 8d57a1a87d1c0c75241a849e21dcdea933307656 Mon Sep 17 00:00:00 2001 From: CleverMouse Date: Mon, 1 Dec 2014 11:19:01 +0000 Subject: [PATCH] newlib: don't report EOF as error from OS layer, higher layer detects EOF as zero-length read git-svn-id: svn://kolibrios.org@5204 a494cfbc-eb01-0410-851d-a64ba20cac60 --- contrib/sdk/sources/newlib/libc/Tupfile.lua | 4 ++-- contrib/sdk/sources/newlib/libc/sys/ioread.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/sdk/sources/newlib/libc/Tupfile.lua b/contrib/sdk/sources/newlib/libc/Tupfile.lua index 2a7d01a023..aabefeecf5 100644 --- a/contrib/sdk/sources/newlib/libc/Tupfile.lua +++ b/contrib/sdk/sources/newlib/libc/Tupfile.lua @@ -42,7 +42,7 @@ CORE_SRCS = { "reent/impure.c", "reent/init_reent.c", "reent/getreent.c", "reent/mutex.c", "reent/gettimeofdayr.c", "reent/isattyr.c", "reent/openr.c", "reent/closer.c", "reent/linkr.c", "reent/readr.c", "reent/lseekr.c", "reent/fstatr.c", - "reent/writer.c", "reent/timesr.c", "reent/unlinkr.c", + "reent/writer.c", "reent/timesr.c", "reent/unlinkr.c", "reent/renamer.c", "search/qsort.c", "search/bsearch.c", "signal/signal.c", "sys/close.c", "sys/create.c", "sys/delete.c", "sys/errno.c", "sys/finfo.c", @@ -84,7 +84,7 @@ STDIO_SRCS = { "tmpfile.c", "tmpnam.c", "ungetc.c", "vasniprintf.c", "vasnprintf.c", "vdprintf.c", "vdiprintf.c", "vscanf.c", "vsprintf.c", "vsnprintf.c", "vsscanf.c", "makebuf.c", "wsetup.c", "wbuf.c", "sccl.c", "siprintf.c", - "sniprintf.c", "snprintf.c", "sprintf.c", "sscanf.c" + "sniprintf.c", "snprintf.c", "sprintf.c", "sscanf.c", "rename.c" } MATH_SRCS = { diff --git a/contrib/sdk/sources/newlib/libc/sys/ioread.c b/contrib/sdk/sources/newlib/libc/sys/ioread.c index 1840c7154e..3ee407c78d 100644 --- a/contrib/sdk/sources/newlib/libc/sys/ioread.c +++ b/contrib/sdk/sources/newlib/libc/sys/ioread.c @@ -26,6 +26,6 @@ int read_file(const char *path, void *buff, "addl $28, %%esp \n\t" :"=a" (retval) :"a"(path),"b"(buff),"c"(offset),"d"(count),"S"(reads)); - return retval; + return retval == 6 ? 0 : retval; };