devkitPro / libfat

FAT library for GBA, DS, Gamecube & Wii
http://devkitpro.org/viewforum.php?f=24
54 stars 36 forks source link

Setting `errno` when removing a non-empty directory #10

Open FrankHB opened 7 years ago

FrankHB commented 7 years ago

The recent change https://github.com/devkitPro/libfat/commit/3fde6ce161db5293a302ef5b839483065526c3b5 is not conforming to POSIX. In fact, EPERM is not only used for "the user didn't have the (write) permission to remove the directory", and it was perfectly valid in sense of conformance. Note Linux also behaves differently, however, not ENOTEMPTY for this case. The changed behavior might introduce confusion, so please clarify it explicitly.