From aeebd22d2e88fd14f1b0624d0bdbc6f791a75892 Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Sun, 16 Nov 2014 13:44:58 +0100 Subject: smb: eliminate unused while loop in OpenDir We loop this at outer level now --- xbmc/filesystem/SMBDirectory.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/xbmc/filesystem/SMBDirectory.cpp b/xbmc/filesystem/SMBDirectory.cpp index 026bd02b65..1fa00e6bff 100644 --- a/xbmc/filesystem/SMBDirectory.cpp +++ b/xbmc/filesystem/SMBDirectory.cpp @@ -253,7 +253,7 @@ int CSMBDirectory::OpenDir(const CURL& url, std::string& strAuth) fd = smbc_opendir(s.c_str()); } - while (fd < 0) /* only to avoid goto in following code */ + if (fd < 0) /* only to avoid goto in following code */ { std::string cError; @@ -261,21 +261,15 @@ int CSMBDirectory::OpenDir(const CURL& url, std::string& strAuth) { if (m_flags & DIR_FLAG_ALLOW_PROMPT) RequireAuthentication(urlIn); - break; } - - if (errno == ENODEV || errno == ENOENT) + else if (errno == ENODEV || errno == ENOENT) cError = StringUtils::Format(g_localizeStrings.Get(770).c_str(),errno); else cError = strerror(errno); if (m_flags & DIR_FLAG_ALLOW_PROMPT) SetErrorDialog(257, cError.c_str()); - break; - } - if (fd < 0) - { // write error to logfile CLog::Log(LOGERROR, "SMBDirectory->GetDirectory: Unable to open directory : '%s'\nunix_err:'%x' error : '%s'", CURL::GetRedacted(strAuth).c_str(), errno, strerror(errno)); } -- cgit v1.2.3