From acfddf7bcb42c07093e4c90f8dbdb3b3b43aad68 Mon Sep 17 00:00:00 2001 From: "David G. Holm" Date: Tue, 13 Jul 1999 00:32:54 +0000 Subject: [PATCH] See ChangeLog entry 19990712-19:15 EDT David G. Holm --- harbour/ChangeLog | 5 +++++ harbour/source/rtl/files.c | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 158212be8a..9002b536c4 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,8 @@ +19990712-19:15 EDT David G. Holm + * source/rtl/files.c + ! hb_fsCreate now creates files that are read-write instead of write-only + ! hb_fsRead now returns 0 instead of 65536U after a read() error + 19990712-22:00 Eddie Runia * source/rtl/classes.c Some more test data left in diff --git a/harbour/source/rtl/files.c b/harbour/source/rtl/files.c index 1423b573ef..b6e881f07a 100644 --- a/harbour/source/rtl/files.c +++ b/harbour/source/rtl/files.c @@ -55,7 +55,7 @@ #endif #ifndef O_BINARY - #define O_BINARY 0 /* O_BINARY not defined on Linux */ + #define O_BINARY 0 /* O_BINARY not defined on Linux */ #endif #ifndef S_IEXEC @@ -211,8 +211,8 @@ static void convert_create_flags( int flags, int *result_flags, unsigned *result { /* by default FC_NORMAL is set */ - *result_flags = O_BINARY | O_CREAT | O_TRUNC | O_WRONLY; - *result_pmode = S_IWUSR; + *result_flags = O_BINARY | O_CREAT | O_TRUNC | O_RDWR; + *result_pmode = S_IRWXU; if( flags & FC_READONLY ) *result_pmode = S_IRUSR; @@ -284,6 +284,7 @@ USHORT hb_fsRead ( FHANDLE handle, BYTEP buff, USHORT count ) errno = 0; bytes = read(handle,buff,count); last_error = errno; + if( bytes == 65535U ) bytes = 0; #else bytes = 0; last_error = FS_ERROR; @@ -445,7 +446,7 @@ BYTEP hb_fsCurDir ( USHORT uiDrive ) last_error = FS_ERROR; #endif #if defined(_MSC_VER) - BYTEP dmm = (BYTEP)cwd_buff; + BYTEP dmm = (BYTEP)cwd_buff; #endif return (BYTEP)cwd_buff; }