print mkdir info in correct order

and only print it when it is needed to be maked.

Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
This commit is contained in:
Lai Jiangshan
2016-04-02 11:37:06 +08:00
parent 6b67c6a296
commit 12ba0a42b2
+1 -1
View File
@@ -108,7 +108,6 @@ int hyper_mkdir(char *hyper_path)
return -1;
}
fprintf(stdout, "create directory %s\n", path);
if (stat(path, &st) >= 0) {
if (S_ISDIR(st.st_mode))
return 0;
@@ -134,6 +133,7 @@ int hyper_mkdir(char *hyper_path)
*p = '/';
}
fprintf(stdout, "create directory %s\n", path);
if (mkdir(path, 0755) < 0 && errno != EEXIST)
return -1;