[zj: modified to not to try to rmdir() dir we haven't created.]
dt = strjoin(d, "/tmp", NULL);
if (!dt) {
r = log_oom();
dt = strjoin(d, "/tmp", NULL);
if (!dt) {
r = log_oom();
if (r) {
log_error("Can't create directory %s: %m", dt);
r = -errno;
if (r) {
log_error("Can't create directory %s: %m", dt);
r = -errno;
}
log_debug("Created temporary directory %s", dt);
}
log_debug("Created temporary directory %s", dt);
rmdir(template);
return r;
}
rmdir(template);
return r;
}