mirror of
				https://github.com/eledio-devices/thirdparty-littlefs.git
				synced 2025-10-31 16:14:16 +01:00 
			
		
		
		
	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.
This commit is contained in:
		| @@ -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; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user