add proper error handling for in-place restarts (Thanks Markus)

fixes #806
This commit is contained in:
Michael Stapelberg
2012-09-21 16:47:43 +02:00
parent 514265b529
commit 8c8fce82e5
2 changed files with 15 additions and 4 deletions

View File

@ -52,7 +52,7 @@ static bool mkdirp(const char *path) {
ELOG("mkdir(%s) failed: %s\n", path, strerror(errno));
return false;
}
char *copy = strdup(path);
char *copy = sstrdup(path);
/* strip trailing slashes, if any */
while (copy[strlen(copy)-1] == '/')
copy[strlen(copy)-1] = '\0';