fix errno handling in scandir:
[musl] / src / thread / sem_wait.c
2011-03-04 Rich Felkerimplement POSIX semaphores