From a9f07a29bdd64a3f7d6247808fd01dee010f7583 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sat, 23 Apr 2016 10:02:52 -0400 Subject: [PATCH] fix move_storage error handling bug (#638) --- src/storage.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/storage.cpp b/src/storage.cpp index ae509695b..6cb36fc0e 100644 --- a/src/storage.cpp +++ b/src/storage.cpp @@ -1179,16 +1179,18 @@ namespace libtorrent stat_file(save_path, &s, e); if (e == boost::system::errc::no_such_file_or_directory) { - create_directories(save_path, ec.ec); - if (ec) + create_directories(save_path, e); + if (e) { + ec.ec = e; ec.file = -1; ec.operation = storage_error::mkdir; return piece_manager::fatal_disk_error; } } - else if (ec) + else if (e) { + ec.ec = e; ec.file = -1; ec.operation = storage_error::mkdir; return piece_manager::fatal_disk_error;