diff options
Diffstat (limited to 'lib/util/src')
-rw-r--r-- | lib/util/src/mkdir_p.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/util/src/mkdir_p.c b/lib/util/src/mkdir_p.c index 993d8ec..784e4ae 100644 --- a/lib/util/src/mkdir_p.c +++ b/lib/util/src/mkdir_p.c @@ -113,11 +113,11 @@ int mkdir_p(const char *path) } if (!CreateDirectoryW(wpath, NULL)) { - error = GetLastError(); + os_error_t err = get_os_error_state(); + set_os_error_state(err); - if (error != ERROR_ALREADY_EXISTS) { - fprintf(stderr, "Creating %s: %ld\n", - path, error); + if (err.w32_errno != ERROR_ALREADY_EXISTS) { + w32_perror(path); goto fail; } } |