mirror of
https://github.com/clearlinux/hyperstart.git
synced 2026-09-03 12:11:34 +00:00
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:
+1
-1
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user