mirror of
https://github.com/clearlinux/clr-debug-info.git
synced 2026-09-05 13:21:33 +00:00
Fix print statements when a dir cannot be created
Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
This commit is contained in:
+5
-3
@@ -641,11 +641,13 @@ int main(__nc_unused__ int argc, __nc_unused__ char *argv[])
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
|
||||
for (size_t i = 0; i < ARRAY_SIZE(required_paths); i++) {
|
||||
if (nc_file_exists(required_paths[i])) {
|
||||
const char *req_path = required_paths[i];
|
||||
if (nc_file_exists(req_path)) {
|
||||
continue;
|
||||
}
|
||||
if (!nc_mkdir_p(required_paths[i], 00755)) {
|
||||
fprintf(stderr, "Failed to mkdir: %s", strerror(errno));
|
||||
if (!nc_mkdir_p(req_path, 00755)) {
|
||||
fprintf(stderr, "Failed to mkdir: %s %s\n", strerror(errno), req_path);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+5
-3
@@ -301,11 +301,13 @@ int main(__nc_unused__ int argc, __nc_unused__ char **argv)
|
||||
const char *required_paths[] = { "/var/cache/debuginfo/lib", "/var/cache/debuginfo/src" };
|
||||
|
||||
for (size_t i = 0; i < ARRAY_SIZE(required_paths); i++) {
|
||||
if (nc_file_exists(required_paths[i])) {
|
||||
const char *req_path = required_paths[i];
|
||||
if (nc_file_exists(req_path)) {
|
||||
continue;
|
||||
}
|
||||
if (!nc_mkdir_p(required_paths[i], 00755)) {
|
||||
fprintf(stderr, "Failed to mkdir: %s", strerror(errno));
|
||||
if (!nc_mkdir_p(req_path, 00755)) {
|
||||
fprintf(stderr, "Failed to mkdir: %s %s\n", strerror(errno), req_path);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user