Changeset 3500 in MondoRescue for branches/3.2


Ignore:
Timestamp:
Feb 9, 2016, 2:42:10 AM (8 years ago)
Author:
Bruno Cornec
Message:
  • Use mr_system to create temp and scratch dir if they do not exist
File:
1 edited

Legend:

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

    r3394 r3500  
    1111#include "my-stuff.h"
    1212#include "mr_mem.h"
     13#include "mr_sys.h"
    1314#include "mondostructures.h"
    1415#include "lib-common-externs.h"
     
    698699        mr_asprintf(tmp, "%s/mondo.tmp.XXXXXX", path);
    699700    } else if (getenv("TMPDIR")) {
     701        mr_system("mkdir -p %s",getenv("TMPDIR"));
    700702        mr_asprintf(tmp, "%s/mondo.tmp.XXXXXX", getenv("TMPDIR"));
    701703    } else if (getenv("MRTMP")) {
     704        mr_system("mkdir -p %s",getenv("MRTMP"));
    702705        mr_asprintf(tmp, "%s/mondo.tmp.XXXXXX", getenv("MRTMP"));
    703706    } else {
     
    743746    /* Always take in account arg first, then env, then default */
    744747    if (path != NULL) {
     748        mr_system("mkdir -p %s",path);
    745749        mr_asprintf(tmp, "%s/mondo.scratch.XXXXXX", path);
    746750    } else if (getenv("MRSCRATCH")) {
     751        mr_system("mkdir -p %s",getenv("MRSCRATCH"));
    747752        mr_asprintf(tmp, "%s/mondo.scratch.XXXXXX", getenv("MRSCRATCH"));
    748753    } else {
Note: See TracChangeset for help on using the changeset viewer.