qcom_msm8916_64_android5.0/sources/qcom/bootable/recovery/updater/install.c
static int make_parents(char* name) {
    char* p;
    for (p = name + (strlen(name)-1); p > name; --p) {
        if (*p != '/') continue;
        *p = '\0';
        if (make_parents(name) < 0) return -1;
        int result = mkdir(name, 0700);
        if (result == 0) printf("created [%s]\n", name);
        *p = '/';
        if (result == 0 || errno == EEXIST) {
            // successfully created or already existed; we're done
            return 0;
        } else {
            printf("failed to mkdir %s: %s\n", name, strerror(errno));
            return -1;
        }
    }
    return 0;
}
// Create all parent directories of name, if necessary.
Create all parent directories of name, if necessary.
Create all parent directories of name if necessary .
static int make_parents(char* name) {
    char* p;
    for (p = name + (strlen(name)-1); p > name; --p) {
        if (*p != '/') continue;
        *p = '\0';
        if (make_parents(name) < 0) return -1;
        int result = mkdir(name, 0700);
        if (result == 0) printf("created [%s]\n", name);
        *p = '/';
        if (result == 0 || errno == EEXIST) {
            return 0;
        } else {
            printf("failed to mkdir %s: %s\n", name, strerror(errno));
            return -1;
        }
    }
    return 0;
}
static int make_parents ( char * name ) { char * p ; for ( p = name + ( strlen ( name ) - 1 ) ; p > name ; -- p ) { if ( * p != ' ' ) continue ; * p = ' \0 ' ; if ( make_parents ( name ) < 0 ) return -1 ; int result = mkdir ( name , 0700 ) ; if ( result == 0 ) printf ( " \n " , name ) ; * p = ' ' ; if ( result == 0 || errno == EEXIST ) { return 0 ; } else { printf ( " \n " , name , strerror ( errno ) ) ; return -1 ; } } return 0 ; }
Create all parent directories of name, if necessary.
Create all parent directories of name if necessary .
// successfully created or already existed; we're done