Return baack first_try in open_temp_file.

GitOrigin-RevId: de86f7b040272ed5bb0bd31ac49ce7ee76385914
This commit is contained in:
levlam 2020-01-16 04:47:28 +03:00
parent 66bd2bfe60
commit 9a40e695bb

View File

@ -739,12 +739,12 @@ Status HttpReader::open_temp_file(CSlice desired_file_name) {
TRY_RESULT(dir, realpath(tmp_dir, true)); TRY_RESULT(dir, realpath(tmp_dir, true));
CHECK(!dir.empty()); CHECK(!dir.empty());
/*
auto first_try = try_open_temp_file(dir, desired_file_name); auto first_try = try_open_temp_file(dir, desired_file_name);
if (first_try.is_ok()) { if (first_try.is_ok()) {
return Status::OK(); return Status::OK();
} }
*/
// Creation of new file with desired name has failed. Trying to create unique directory for it // Creation of new file with desired name has failed. Trying to create unique directory for it
TRY_RESULT(directory, mkdtemp(dir, TEMP_DIRECTORY_PREFIX)); TRY_RESULT(directory, mkdtemp(dir, TEMP_DIRECTORY_PREFIX));
auto second_try = try_open_temp_file(directory, desired_file_name); auto second_try = try_open_temp_file(directory, desired_file_name);