From: eck Date: Mon, 9 Apr 1990 15:55:51 +0000 (+0000) Subject: file creation on f[re]open() was still wrong X-Git-Tag: release-5-5~1749 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=a3bd2c67344e032973a68c25416fcd6430d3073e;p=ack.git file creation on f[re]open() was still wrong --- diff --git a/lang/cem/libcc.ansi/stdio/fopen.c b/lang/cem/libcc.ansi/stdio/fopen.c index 5fe89be28..bc2e1ed6b 100644 --- a/lang/cem/libcc.ansi/stdio/fopen.c +++ b/lang/cem/libcc.ansi/stdio/fopen.c @@ -88,7 +88,7 @@ fopen(const char *name, const char *mode) */ if ((rwflags & O_TRUNC) || (((fd = _open(name, rwmode)) < 0) - && (flags & _IOWRITE))) { + && (rwflags & O_CREAT))) { if (((fd = _creat(name, PMODE)) > 0) && flags | _IOREAD) { (void) _close(fd); fd = _open(name, rwmode); diff --git a/lang/cem/libcc.ansi/stdio/freopen.c b/lang/cem/libcc.ansi/stdio/freopen.c index af384b70d..41887f861 100644 --- a/lang/cem/libcc.ansi/stdio/freopen.c +++ b/lang/cem/libcc.ansi/stdio/freopen.c @@ -68,7 +68,7 @@ freopen(const char *name, const char *mode, FILE *stream) if ((rwflags & O_TRUNC) || (((fd = _open(name, rwmode)) < 0) - && (flags & _IOWRITE))) { + && (rwflags & O_CREAT))) { if (((fd = _creat(name, PMODE)) < 0) && flags | _IOREAD) { (void) _close(fd); fd = _open(name, rwmode);