[vlc-commits] [Git][videolan/vlc][master] 2 commits: nfs: fix pf_read return values

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Thu Mar 3 22:28:23 UTC 2022



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
59a3d85d by Thomas Guillem at 2022-03-03T22:10:14+00:00
nfs: fix pf_read return values

0 should be returned in case of EOS or error, -1 means EAGAIN.

/me blames me for not reading the documentation.

- - - - -
249a76b9 by Thomas Guillem at 2022-03-03T22:10:14+00:00
smb2: fix pf_read return values

0 should be returned in case of EOS or error, -1 means EAGAIN.

/me blames me for not reading the documentation.

- - - - -


2 changed files:

- modules/access/nfs.c
- modules/access/smb2.c


Changes:

=====================================
modules/access/nfs.c
=====================================
@@ -213,11 +213,11 @@ FileRead(stream_t *p_access, void *p_buf, size_t i_len)
                        p_access) < 0)
     {
         msg_Err(p_access, "nfs_read_async failed");
-        return -1;
+        return 0;
     }
 
     if (vlc_nfs_mainloop(p_access, nfs_read_finished_cb) < 0)
-        return -1;
+        return 0;
 
     return p_sys->res.read.i_len;
 }


=====================================
modules/access/smb2.c
=====================================
@@ -278,10 +278,7 @@ FileRead(stream_t *access, void *buf, size_t len)
 {
     struct access_sys *sys = access->p_sys;
 
-    if (sys->error_status != 0)
-        return -1;
-
-    if (sys->eof)
+    if (sys->eof || sys->error_status != 0)
         return 0;
 
     /* Limit the read size since smb2_read_async() will complete only after
@@ -297,13 +294,13 @@ FileRead(stream_t *access, void *buf, size_t len)
                         smb2_read_cb, &op) < 0)
     {
         VLC_SMB2_SET_ERROR(&op, "smb2_read_async", 1);
-        return -1;
+        return 0;
     }
 
     if (vlc_smb2_mainloop(&op, false) < 0)
     {
         sys->error_status = op.error_status;
-        return -1;
+        return 0;
     }
 
     if (op.res.read.len == 0)



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a37715916283d42cdfd97d25810b2fa32674cba9...249a76b921b1a742ae9d4fa459ea7107bca08482

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a37715916283d42cdfd97d25810b2fa32674cba9...249a76b921b1a742ae9d4fa459ea7107bca08482
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list