projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix system breakage window during make install due to permissions
[musl]
/
src
/
dirent
/
readdir.c
diff --git
a/src/dirent/readdir.c
b/src/dirent/readdir.c
index
1aeb25a
..
98ec029
100644
(file)
--- a/
src/dirent/readdir.c
+++ b/
src/dirent/readdir.c
@@
-1,11
+1,5
@@
#include <dirent.h>
#include <dirent.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <limits.h>
#include "__dirent.h"
#include "__dirent.h"
-#include "syscall.h"
#include "libc.h"
int __getdents(int, struct dirent *, size_t);
#include "libc.h"
int __getdents(int, struct dirent *, size_t);
@@
-16,10
+10,7
@@
struct dirent *readdir(DIR *dir)
if (dir->buf_pos >= dir->buf_end) {
int len = __getdents(dir->fd, (void *)dir->buf, sizeof dir->buf);
if (dir->buf_pos >= dir->buf_end) {
int len = __getdents(dir->fd, (void *)dir->buf, sizeof dir->buf);
- if (len < 0) {
- dir->lock = 0;
- return NULL;
- } else if (len == 0) return 0;
+ if (len <= 0) return 0;
dir->buf_end = len;
dir->buf_pos = 0;
}
dir->buf_end = len;
dir->buf_pos = 0;
}