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 | |
parent | various changes (diff) | |
download | rtems-6982ed7826d8717d46ceed40bc8db556cd669ed8.tar.bz2 |
Do not overwrite errno in case fat_file_write() returns with an error status.
-rw-r--r-- | cpukit/ChangeLog | 5 | ||||
-rw-r--r-- | cpukit/libfs/src/dosfs/msdos_misc.c | 8 |
2 files changed, 11 insertions, 2 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 65b644acd6..4d1d8187e0 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,8 @@ +2010-03-11 Sebastian Huber <sebastian.huber@embedded-brains.de> + + * libfs/src/dosfs/msdos_misc.c: Do not overwrite errno in case + fat_file_write() returns with an error status. + 2010-03-11 Ken Peters <kptrs@yahoo.com> PR 1456/cpukit 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++; |