vlc | branch: master | Thomas Guillem <[email protected]> | Tue Feb 12 11:54:30 
2019 +0100| [ba9fd0f0efd9dc9b166f1ddfdbae0634afd38b2c] | committer: Thomas 
Guillem

smb2: change error handling

Some errors are not critical and should not be displayed.
Display error from dialog, only one time, if the Open() failed.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ba9fd0f0efd9dc9b166f1ddfdbae0634afd38b2c
---

 modules/access/smb2.c | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/modules/access/smb2.c b/modules/access/smb2.c
index 48bcf0131d..8c91468ed8 100644
--- a/modules/access/smb2.c
+++ b/modules/access/smb2.c
@@ -105,17 +105,8 @@ smb2_check_status(stream_t *access, int status, const char 
*psz_func)
 
     if (status < 0)
     {
-        if (status != -EINTR)
-        {
-            const char *psz_error = smb2_get_error(sys->smb2);
-            msg_Err(access, "%s failed: %d, '%s'", psz_func, status, 
psz_error);
-            if (sys->error_status == 0)
-                vlc_dialog_display_error(access,
-                                         _("SMB2 operation failed"), "%s",
-                                         psz_error);
-        }
-        else
-            msg_Warn(access, "%s interrupted", psz_func);
+        const char *psz_error = smb2_get_error(sys->smb2);
+        msg_Warn(access, "%s failed: %d, '%s'", psz_func, status, psz_error);
         sys->error_status = status;
         return -1;
     }
@@ -659,7 +650,12 @@ Open(vlc_object_t *p_obj)
     vlc_credential_clean(&credential);
 
     if (ret != 0)
+    {
+        vlc_dialog_display_error(access,
+                                 _("SMB2 operation failed"), "%s",
+                                 smb2_get_error(sys->smb2));
         goto error;
+    }
 
     if (sys->smb2fh != NULL)
     {

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to