Skip to content

Commit

Permalink
Add returns (bazelbuild#634)
Browse files Browse the repository at this point in the history
Missed with 84286ad.

Also reverts the hard error on not creating directories. It could try to create the same directory multiple times, and the previous behavior silently errored on those. This can get fixed up in a later change to only try to create each directory once, and to only error if the directory doesn't already exist.
  • Loading branch information
brentleyjones authored Jun 7, 2021
1 parent 84286ad commit 254e3fa
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tools/worker/work_processor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,8 @@ void WorkProcessor::ProcessWorkRequest(
// incremental storage area.
auto dir_path = Dirname(expected_object_pair.second);
if (!MakeDirs(dir_path, S_IRWXU)) {
stderr_stream << "swift_worker: Could not create directory " << dir_path
<< " (errno " << errno << ")\n";
FinalizeWorkRequest(request, response, EXIT_FAILURE, stderr_stream);
std::cerr << "Could not create directory " << dir_path << " (errno "
<< errno << ")\n";
}
}

Expand All @@ -147,6 +146,7 @@ void WorkProcessor::ProcessWorkRequest(
<< expected_object_pair.first << " (errno " << errno
<< ")\n";
FinalizeWorkRequest(request, response, EXIT_FAILURE, stderr_stream);
return;
}
}
}
Expand All @@ -166,6 +166,7 @@ void WorkProcessor::ProcessWorkRequest(
<< expected_object_pair.first << " (errno " << errno
<< ")\n";
FinalizeWorkRequest(request, response, EXIT_FAILURE, stderr_stream);
return;
}
}

Expand All @@ -185,6 +186,7 @@ void WorkProcessor::ProcessWorkRequest(
<< expected_object_pair.second << " (errno " << errno
<< ")\n";
FinalizeWorkRequest(request, response, EXIT_FAILURE, stderr_stream);
return;
}
}
}
Expand Down

0 comments on commit 254e3fa

Please sign in to comment.