10 int make_directory(const char *dir
)
12 char *s
= strdup(dir
);
19 /* Bypass leading non-'/'s and then subsequent '/'s. */
25 c
= *s
; /* Save the current char */
26 *s
= 0; /* and replace it with nul. */
32 if (mkdir(path
, 0777) < 0) {
34 /* If we failed for any other reason than the directory
35 * already exists, output a diagnostic and return -1.*/
46 /* Remove any inserted nul from the path (recursive mode). */
56 EXPORT_SYMBOL(make_directory
);