Add timeout support in wait_for_nfs_reply
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>libnfs-4.0.0-vitalif
parent
128ac2f725
commit
3ba14aabc2
|
@ -153,13 +153,10 @@ static void wait_for_nfs_reply(struct nfs_context *nfs, struct sync_cb_data *cb_
|
|||
pfd.fd = nfs_get_fd(nfs);
|
||||
pfd.events = nfs_which_events(nfs);
|
||||
|
||||
ret = poll(&pfd, 1, nfs_get_timeout(nfs));
|
||||
ret = poll(&pfd, 1, 100);
|
||||
if (ret < 0) {
|
||||
nfs_set_error(nfs, "Poll failed");
|
||||
revents = -1;
|
||||
} else if(ret == 0) {
|
||||
nfs_set_error(nfs, "Timed out after [%d] milliseconds",nfs_get_timeout(nfs));
|
||||
revents = -1;
|
||||
} else {
|
||||
revents = pfd.revents;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue