summaryrefslogtreecommitdiffstats
path: root/cpukit/libfs/src/dosfs/msdos_misc.c
diff options
context:
space:
mode:
authorThomas Doerfler <Thomas.Doerfler@embedded-brains.de>2010-03-12 08:31:31 +0000
committerThomas Doerfler <Thomas.Doerfler@embedded-brains.de>2010-03-12 08:31:31 +0000
commit6982ed7826d8717d46ceed40bc8db556cd669ed8 (patch)
tree6e41369de67f8da39e3b61de0df2e6fae1bc3360 /cpukit/libfs/src/dosfs/msdos_misc.c
parentvarious changes (diff)
downloadrtems-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.c8
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++;