From da1dbd6e6aa441e9edc838483ddb745e2aa90928 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 21 May 2018 23:02:26 -0700 Subject: [PATCH] fastboot: better temporary file errors. Bug: http://b/80082652 Test: N/A Change-Id: Ib9f34342157ea3a15fd48504d03f4f3a2c710579 --- fastboot/fastboot.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp index 9463cc917..649326280 100644 --- a/fastboot/fastboot.cpp +++ b/fastboot/fastboot.cpp @@ -507,7 +507,8 @@ static std::string make_temporary_template() { static std::string make_temporary_directory() { std::string result(make_temporary_template()); if (mkdtemp(&result[0]) == nullptr) { - die("unable to create temporary directory: %s", strerror(errno)); + die("unable to create temporary directory with template %s: %s", + result.c_str(), strerror(errno)); } return result; } @@ -516,7 +517,8 @@ static int make_temporary_fd(const char* what) { std::string path_template(make_temporary_template()); int fd = mkstemp(&path_template[0]); if (fd == -1) { - die("failed to create temporary file for %s: %s\n", what, strerror(errno)); + die("failed to create temporary file for %s with template %s: %s\n", + path_template.c_str(), what, strerror(errno)); } unlink(path_template.c_str()); return fd;