tmpfs: calling unlink() on a directory which isn't empty should fail
Calling unlink() on a directory which isn't empty should fail. Instead the directory gets removed but its entries don't get freed. This is similar to #7203, which is specific to freeing empty directories. How this wasn't caught sooner has me scratching my head.
It seems like we have two choices for the errno.
ENOTEMPTY - what freebsd would return
EEXIST - this seems more illumos-like
Updated by Andrew Stormont about 4 years ago
I opted to have the function return EEXIST which seems to be in-keeping with the spec: