search for: cleanup_fail

Displaying 2 results from an estimated 2 matches for "cleanup_fail".

2011 Jul 29
3
[PATCH 1/3] klibc: Add scandir() and alphasort() support.
...nt; + size_t count = 0; + size_t allocated = 0; + DIR *dir; + + dir = opendir(dirp); + if (!dir) + return -1; + + while (1) { + dirent = readdir(dir); + if (!dirent) + break; + if (!filter || filter(dirent)) { + struct dirent *copy; + copy = malloc(sizeof(*copy)); + if (!copy) + goto cleanup_fail; + memcpy(copy, dirent, sizeof(*copy)); + + /* Extend the array if needed */ + if (count == allocated) { + if (allocated == 0) + allocated = 15; /* ~1 page worth */ + else + allocated *= 2; + next_nl = realloc(nl, allocated); + if (!next_nl) { + free(copy); + goto...
2011 Aug 02
6
[PATCH v2 0/4] Support drop directories directly from kinit
This patchset applies to klibc mainline. This patchset introduces the ability to kinit to execute scripts or executable files present in in the initramfs before switching over to the root filesystem. It is implemented by first implementing scandir() and alphasort() as present in POSIX.1-2008 in klibc itself, and then using that as the basis for iterating and executing files via a run_scripts()