mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-26 20:40:28 +00:00
Make some systemic improvements
- add vdso dump utility - tests now log stack usage - rename g_ftrace to __ftrace - make internal spinlocks go faster - add conformant c11 atomics library - function tracing now logs stack usage - make function call tracing thread safe - add -X unsecure (no ssl) mode to redbean - munmap() has more consistent behavior now - pacify fsync() calls on python unit tests - make --strace flag work better in redbean - start minimizing and documenting compiler flags
This commit is contained in:
parent
c6bbca55e9
commit
9208c83f7a
141 changed files with 1948 additions and 1411 deletions
|
@ -29,11 +29,13 @@
|
|||
static int MakeDirs(const char *path, unsigned mode, int e) {
|
||||
int rc;
|
||||
char *dir;
|
||||
if (mkdir(path, mode) != -1) {
|
||||
if (mkdir(path, mode) != -1 || errno == EEXIST) {
|
||||
errno = e;
|
||||
return 0;
|
||||
}
|
||||
if (errno != ENOENT) return -1;
|
||||
if (errno != ENOENT) {
|
||||
return -1;
|
||||
}
|
||||
dir = xdirname(path);
|
||||
if (strcmp(dir, path)) {
|
||||
rc = MakeDirs(dir, mode, e);
|
||||
|
@ -49,6 +51,8 @@ static int MakeDirs(const char *path, unsigned mode, int e) {
|
|||
/**
|
||||
* Recursively creates directory a.k.a. folder.
|
||||
*
|
||||
* This function won't fail if the directory already exists.
|
||||
*
|
||||
* @param path is a UTF-8 string, preferably relative w/ forward slashes
|
||||
* @param mode can be, for example, 0755
|
||||
* @return 0 on success or -1 w/ errno
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue