kodi: add PR5817

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2014-11-25 20:53:24 +01:00
parent 04484133aa
commit 2d1585e8fe

View File

@ -0,0 +1,46 @@
From fda83f7aa4a82b8494e0b4e4a6a254d5784b5919 Mon Sep 17 00:00:00 2001
From: Rainer Hochecker <fernetmenta@online.de>
Date: Tue, 25 Nov 2014 20:33:18 +0100
Subject: [PATCH] Revert "smb: eliminate unused while loop in OpenDir"
This reverts commit aeebd22d2e88fd14f1b0624d0bdbc6f791a75892.
---
xbmc/filesystem/SMBDirectory.cpp | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/xbmc/filesystem/SMBDirectory.cpp b/xbmc/filesystem/SMBDirectory.cpp
index 1fa00e6..026bd02 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));
}