Skip to content

Commit 3fbd2f2

Browse files
okunzcopybara-github
authored andcommitted
stack_trace.cc: Log error when delete temporary directory fails.
PiperOrigin-RevId: 742666158 Change-Id: I498bdb16540736899ced17eb3d58e190e5642b02
1 parent 532c02c commit 3fbd2f2

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

sandboxed_api/sandbox2/stack_trace.cc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,11 @@ absl::StatusOr<std::vector<std::string>> StackTracePeer::LaunchLibunwindSandbox(
203203
return absl::InternalError(
204204
"Could not create temporary directory for unwinding");
205205
}
206-
struct UnwindTempDirectoryCleanup {
207-
~UnwindTempDirectoryCleanup() {
208-
file_util::fileops::DeleteRecursively(capture);
206+
absl::Cleanup delete_unwind_temp_directory = [&unwind_temp_directory] {
207+
if (!file_util::fileops::DeleteRecursively(unwind_temp_directory)) {
208+
LOG(ERROR) << "Failed to delete " << unwind_temp_directory;
209209
}
210-
char* capture;
211-
} cleanup{unwind_temp_directory};
210+
};
212211

213212
// Copy over important files from the /proc directory as we can't mount them.
214213
const std::string unwind_temp_maps_path =

0 commit comments

Comments
 (0)