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_r.c
diff --git
a/src/dirent/readdir_r.c
b/src/dirent/readdir_r.c
index
58f6032
..
daa6c6e
100644
(file)
--- a/
src/dirent/readdir_r.c
+++ b/
src/dirent/readdir_r.c
@@
-1,28
+1,27
@@
#include <dirent.h>
#include <errno.h>
#include <dirent.h>
#include <errno.h>
-#include <stdlib.h>
#include <string.h>
#include "__dirent.h"
#include "libc.h"
#include <string.h>
#include "__dirent.h"
#include "libc.h"
-int readdir_r(DIR *
dir, struct dirent *buf, struct dirent **
result)
+int readdir_r(DIR *
restrict dir, struct dirent *restrict buf, struct dirent **restrict
result)
{
struct dirent *de;
int errno_save = errno;
int ret;
{
struct dirent *de;
int errno_save = errno;
int ret;
- LOCK(
&
dir->lock);
+ LOCK(dir->lock);
errno = 0;
de = readdir(dir);
if ((ret = errno)) {
errno = 0;
de = readdir(dir);
if ((ret = errno)) {
- UNLOCK(
&
dir->lock);
+ UNLOCK(dir->lock);
return ret;
}
errno = errno_save;
if (de) memcpy(buf, de, de->d_reclen);
else buf = NULL;
return ret;
}
errno = errno_save;
if (de) memcpy(buf, de, de->d_reclen);
else buf = NULL;
- UNLOCK(
&
dir->lock);
+ UNLOCK(dir->lock);
*result = buf;
return 0;
}
*result = buf;
return 0;
}