musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat
-rw-r--r--src/dirent/scandir.c 3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/dirent/scandir.c b/src/dirent/scandir.c
index 6a0a9993..aad813ac 100644
--- a/src/dirent/scandir.c
+++ b/src/dirent/scandir.c
@@ -35,12 +35,11 @@ int scandir(const char *path, struct dirent ***res,
closedir(d);
if (errno) {
- old_errno = errno;
if (names) while (cnt-->0) free(names[cnt]);
free(names);
- errno = old_errno;
return -1;
}
+ errno = old_errno;
if (cmp) qsort(names, cnt, sizeof *names, (int (*)(const void *, const void *))cmp);
*res = names;
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月06日 21:55:10 +0000

AltStyle によって変換されたページ (->オリジナル) /