Changeset 3507


Ignore:
Timestamp:
Feb 13, 2016, 2:55:26 AM (22 months ago)
Author:
bruno
Message:
  • Use a mr_system where appropriate
  • Fix mkstemp which is creating a file, preventing directory creation (compared to mktemp)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mondo/src/common/libmondo-tools.c

    r3504 r3507  
    670670char* mkdtemp(char *template)
    671671{
    672     if (mkstemp(template) == NULL || mkdir(template, 0700) != 0)
     672    if (mkstemp(template) == NULL) {
    673673        return NULL;
     674    }
     675    unlink(template);
     676    if (mkdir(template, 0700) != 0) {
     677        return NULL;
     678    }
    674679    return template;
    675680}
     
    724729    log_it("bkpinfo->tmpdir is being set to %s", bkpinfo->tmpdir);
    725730
    726     mr_asprintf(tmp, "mkdir -p %s/tmpfs", bkpinfo->tmpdir);
    727     paranoid_system(tmp);
    728     mr_free(tmp);
     731    mr_system("mkdir -p %s/tmpfs", bkpinfo->tmpdir);
    729732}
    730733
Note: See TracChangeset for help on using the changeset viewer.