Skip to content
Snippets Groups Projects
Commit a945944c authored by Steve Lhomme's avatar Steve Lhomme
Browse files

nfs: fix libnfs API v2 support


Introduced in libnfs 6.0.0.

Co-authored-by: default avatarronnie sahlberg <ronniesahlberg@gmail.com>
Co-authored-by: default avatarThomas Guillem <thomas@gllm.fr>
parent acf6f375
No related branches found
No related tags found
1 merge request!6527nfs: fix libnfs API v2 support
Pipeline #545708 passed with stage
in 12 minutes and 56 seconds
......@@ -188,7 +188,8 @@ nfs_read_cb(int i_status, struct nfs_context *p_nfs, void *p_data,
else
{
p_sys->res.read.i_len = i_status;
memcpy(p_sys->res.read.p_buf, p_data, i_status);
if (p_sys->res.read.p_buf != NULL && p_data != NULL)
memcpy(p_sys->res.read.p_buf, p_data, i_status);
}
}
......@@ -208,9 +209,15 @@ FileRead(stream_t *p_access, void *p_buf, size_t i_len)
return 0;
p_sys->res.read.i_len = 0;
#ifdef LIBNFS_API_V2
p_sys->res.read.p_buf = NULL;
if (nfs_read_async(p_sys->p_nfs, p_sys->p_nfsfh, p_buf, i_len, nfs_read_cb,
p_access) < 0)
#else
p_sys->res.read.p_buf = p_buf;
if (nfs_read_async(p_sys->p_nfs, p_sys->p_nfsfh, i_len, nfs_read_cb,
p_access) < 0)
#endif
{
msg_Err(p_access, "nfs_read_async failed");
return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment