diff options
author | Christopher Haster <chaster@utexas.edu> | 2018-01-23 04:28:29 +0300 |
---|---|---|
committer | Christopher Haster <chaster@utexas.edu> | 2018-01-23 04:28:29 +0300 |
commit | 997c2e594e2880b15d3ec069aae4320c110c3bf0 (patch) | |
tree | 215c30e6769eeca62872e5a578072859bcb9e4ac /emubd | |
parent | d88f0ac02ff93b549418d38d464b5591fce4f688 (diff) |
Fixed incorrect reliance on errno in emubd
When running the tests, the emubd erase function relied on the value of
errno to not change over a possible call to unlink. Annoyingly, I've
only seen this cause problems on a couple of specific Travis instances
while self-hosting littlefs on top of littlefs-fuse.
Diffstat (limited to 'emubd')
-rw-r--r-- | emubd/lfs_emubd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/emubd/lfs_emubd.c b/emubd/lfs_emubd.c index b87d6de..fb518a8 100644 --- a/emubd/lfs_emubd.c +++ b/emubd/lfs_emubd.c @@ -196,7 +196,7 @@ int lfs_emubd_erase(const struct lfs_config *cfg, lfs_block_t block) { } } - if (errno == ENOENT || (S_ISREG(st.st_mode) && (S_IWUSR & st.st_mode))) { + if (err || (S_ISREG(st.st_mode) && (S_IWUSR & st.st_mode))) { FILE *f = fopen(emu->path, "w"); if (!f) { return -errno; |