diff options
author | Manuel Novoa III <mjn3@codepoet.org> | 2002-03-12 19:17:50 +0000 |
---|---|---|
committer | Manuel Novoa III <mjn3@codepoet.org> | 2002-03-12 19:17:50 +0000 |
commit | f2f500d61c071f14ad4eb0605482e62b8aec2b31 (patch) | |
tree | b10100f4867463e8094e47adc2088b20b7e3ac28 /libc/stdio/stdio.c | |
parent | b6d85765b07a3e843253b6be02d82947842af9d2 (diff) |
Fix another O_LARGEFILE bug. Also, I forget to make floating point optional
in the new printf code.
Diffstat (limited to 'libc/stdio/stdio.c')
-rw-r--r-- | libc/stdio/stdio.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libc/stdio/stdio.c b/libc/stdio/stdio.c index 6d4bf40ec..e54274112 100644 --- a/libc/stdio/stdio.c +++ b/libc/stdio/stdio.c @@ -41,6 +41,13 @@ #include <unistd.h> #include <fcntl.h> +#ifndef O_LARGEFILE /* uClibc undefines this if no large file support. */ +#ifdef __STDIO_LARGE_FILES +#error missing define for O_LARGEFILE! +#endif +#define O_LARGEFILE 0 +#endif + /**********************************************************************/ /* First deal with some build issues... */ @@ -2170,7 +2177,7 @@ FILE *_stdio_fopen(const char * __restrict filename, } else { #ifdef __STDIO_LARGE_FILES if (filedes < -1) { - open_mode |= __FLAG_LARGEFILE; + open_mode |= O_LARGEFILE; } #endif /* __STDIO_LARGE_FILES */ stream->filedes = open(filename, open_mode, 0666); @@ -2193,7 +2200,8 @@ FILE *_stdio_fopen(const char * __restrict filename, #ifdef __STDIO_BUFFERS (isatty(stream->filedes) * __FLAG_LBF) | #endif /* __STDIO_BUFFERS */ -#if (O_APPEND == __FLAG_APPEND) && (O_LARGEFILE == __FLAG_LARGEFILE) +#if (O_APPEND == __FLAG_APPEND) \ +&& ((O_LARGEFILE == __FLAG_LARGEFILE) || (O_LARGEFILE == 0)) (open_mode & (O_APPEND|O_LARGEFILE)) | /* i386 linux and elks */ #else /* (O_APPEND == __FLAG_APPEND) && (O_LARGEFILE == __FLAG_LARGEFILE) */ ((open_mode & O_APPEND) ? __FLAG_APPEND : 0) | |