From 08c09e2439e2ccf6293015894c8a291ddcf0b6e5 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 22 Oct 2003 16:35:18 +0000 Subject: [PATCH] 2003-10-22 Ralf Corsepius PR 509/filesystem * src/dosfs/fat.c: _fat_block_read and _fat_block_write return error codes instead of -1 in case of errors, as they are supposed to do according to the comments documenting these functions. --- cpukit/libfs/ChangeLog | 7 +++++++ cpukit/libfs/src/dosfs/fat.c | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/cpukit/libfs/ChangeLog b/cpukit/libfs/ChangeLog index 07923ec407..ecb1bf50c1 100644 --- a/cpukit/libfs/ChangeLog +++ b/cpukit/libfs/ChangeLog @@ -1,3 +1,10 @@ +2003-10-22 Ralf Corsepius + + PR 509/filesystem + * src/dosfs/fat.c: _fat_block_read and _fat_block_write return error + codes instead of -1 in case of errors, as they are supposed to do + according to the comments documenting these functions. + 2003-10-22 Joel Sherrill PR 440/filesystem diff --git a/cpukit/libfs/src/dosfs/fat.c b/cpukit/libfs/src/dosfs/fat.c index b34a9cb947..586f1dca73 100644 --- a/cpukit/libfs/src/dosfs/fat.c +++ b/cpukit/libfs/src/dosfs/fat.c @@ -64,8 +64,8 @@ _fat_block_read( { rc = fat_buf_access(fs_info, blk, FAT_OP_TYPE_READ, &block); if (rc != RC_OK) - return rc; - + return -1; + c = MIN(count, (fs_info->vol.bps - ofs)); memcpy((buff + cmpltd), (block->buffer + ofs), c); @@ -119,7 +119,7 @@ _fat_block_write( else rc = fat_buf_access(fs_info, blk, FAT_OP_TYPE_READ, &block); if (rc != RC_OK) - return rc; + return -1; memcpy((block->buffer + ofs), (buff + cmpltd), c);