diff options
author | Thomas Doerfler <Thomas.Doerfler@embedded-brains.de> | 2010-03-12 08:31:31 +0000 |
---|---|---|
committer | Thomas Doerfler <Thomas.Doerfler@embedded-brains.de> | 2010-03-12 08:31:31 +0000 |
commit | 6982ed7826d8717d46ceed40bc8db556cd669ed8 (patch) | |
tree | 6e41369de67f8da39e3b61de0df2e6fae1bc3360 /cpukit/libfs/src/dosfs/msdos_misc.c | |
parent | various changes (diff) | |
download | rtems-6982ed7826d8717d46ceed40bc8db556cd669ed8.tar.bz2 |
Do not overwrite errno in case fat_file_write() returns with an error status.
Diffstat (limited to 'cpukit/libfs/src/dosfs/msdos_misc.c')
-rw-r--r-- | cpukit/libfs/src/dosfs/msdos_misc.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cpukit/libfs/src/dosfs/msdos_misc.c b/cpukit/libfs/src/dosfs/msdos_misc.c index 4ab8e22b32..67573b8505 100644 --- a/cpukit/libfs/src/dosfs/msdos_misc.c +++ b/cpukit/libfs/src/dosfs/msdos_misc.c @@ -1447,7 +1447,9 @@ int msdos_find_name_in_fat_file( #if MSDOS_FIND_PRINT printf ("MSFS:[9.4] clear write: %d\n", ret); #endif - if (ret != bts2rd) + if (ret == -1) + return ret; + else if (ret != bts2rd) rtems_set_errno_and_return_minus_one(EIO); } } @@ -1556,7 +1558,9 @@ int msdos_find_name_in_fat_file( ret = fat_file_write(mt_entry, fat_fd, (empty_space_offset * bts2rd) + empty_space_entry, length, fs_info->cl_buf + empty_space_entry); - if (ret != length) + if (ret == -1) + return ret; + else if (ret != length) rtems_set_errno_and_return_minus_one(EIO); empty_space_offset++; |