Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #include <dirent.h> | 1 #include <dirent.h> |
| 2 #include <string.h> | 2 #include <string.h> |
| 3 #include <stdlib.h> | 3 #include <stdlib.h> |
| 4 #include <stdint.h> | 4 #include <stdint.h> |
| 5 #include <errno.h> | 5 #include <errno.h> |
| 6 #include <stddef.h> | 6 #include <stddef.h> |
| 7 #include "libc.h" | 7 #include "libc.h" |
| 8 | 8 |
| 9 int scandir(const char* path, | 9 int scandir(const char* path, |
| 10 struct dirent*** res, | 10 struct dirent*** res, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 45 free(names); | 45 free(names); |
| 46 return -1; | 46 return -1; |
| 47 } | 47 } |
| 48 errno = old_errno; | 48 errno = old_errno; |
| 49 | 49 |
| 50 if (cmp) | 50 if (cmp) |
| 51 qsort(names, cnt, sizeof *names, (int (*)(const void*, const void*))cmp); | 51 qsort(names, cnt, sizeof *names, (int (*)(const void*, const void*))cmp); |
| 52 *res = names; | 52 *res = names; |
| 53 return cnt; | 53 return cnt; |
| 54 } | 54 } |
| 55 | |
| 56 LFS64(scandir); | |
| OLD | NEW |