diff options
author | Rainer Hochecker <fernetmenta@online.de> | 2014-11-25 20:33:18 +0100 |
---|---|---|
committer | Memphiz <memphis@machzwo.de> | 2014-11-25 23:34:19 +0100 |
commit | 149449d47eed8b383af06f25dc5017dd6809bf6d (patch) | |
tree | efecd42f4ba0e46886d50351582208bbf4b6af55 | |
parent | 4465fbfa715d02dd6ebbfa1b90fa315a6b75a7d2 (diff) |
Revert "smb: eliminate unused while loop in OpenDir"
This reverts commit aeebd22d2e88fd14f1b0624d0bdbc6f791a75892.
Revert-reason: the commit broke the automated auth request dialog on password secured samba shares (dialog didn't show up - instead an empty error dialog was visible)
-rw-r--r-- | xbmc/filesystem/SMBDirectory.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/xbmc/filesystem/SMBDirectory.cpp b/xbmc/filesystem/SMBDirectory.cpp index 1fa00e6bff..026bd02b65 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()); } - if (fd < 0) /* only to avoid goto in following code */ + while (fd < 0) /* only to avoid goto in following code */ { std::string cError; @@ -261,15 +261,21 @@ int CSMBDirectory::OpenDir(const CURL& url, std::string& strAuth) { if (m_flags & DIR_FLAG_ALLOW_PROMPT) RequireAuthentication(urlIn); + break; } - else if (errno == ENODEV || errno == ENOENT) + + 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)); } |