mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-22 20:16:54 +03:00
use compatability macro for mkdir
This commit is contained in:
parent
1fd565cba7
commit
5dd6fa6f22
@ -31,6 +31,7 @@
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "utils/utils.h"
|
||||
#include "utils/config.h"
|
||||
#include "utils/filepath.h"
|
||||
|
||||
@ -378,7 +379,7 @@ nserror filepath_mkdir_all(const char *fname)
|
||||
while ((sep = strchr(sep, '/')) != NULL) {
|
||||
*sep = 0;
|
||||
if (stat(dname, &sb) != 0) {
|
||||
if (mkdir(dname, S_IRWXU) != 0) {
|
||||
if (nsmkdir(dname, S_IRWXU) != 0) {
|
||||
/* could not create path element */
|
||||
free(dname);
|
||||
return NSERROR_NOT_FOUND;
|
||||
|
@ -60,10 +60,13 @@ struct dirent;
|
||||
#define PRId64 "lld"
|
||||
#endif
|
||||
|
||||
/* Windows does not have POSIX formating codes or mkdir so work around that */
|
||||
#if defined(_WIN32)
|
||||
#define SSIZET_FMT "Iu"
|
||||
#define nsmkdir(dir, mode) mkdir((dir))
|
||||
#else
|
||||
#define SSIZET_FMT "zd"
|
||||
#define nsmkdir(dir, mode) mkdir((dir), (mode))
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && (__GNUC__ < 3)
|
||||
@ -105,12 +108,6 @@ typedef struct
|
||||
void (*cancel)(query_id, enum query_response res, void *pw);
|
||||
} query_callback;
|
||||
|
||||
#ifdef HAVE_MKDIR
|
||||
#define nsmkdir(dir, mode) mkdir((dir), (mode))
|
||||
#else
|
||||
#define nsmkdir(dir, mode) mkdir((dir))
|
||||
#endif
|
||||
|
||||
#ifndef timeradd
|
||||
#define timeradd(a, aa, result) \
|
||||
do { \
|
||||
|
Loading…
Reference in New Issue
Block a user