From a3d44462cb5b10be80d622b964aabd12b212442a Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Sun, 9 Oct 2011 19:10:18 +1100 Subject: [PATCH] Sync API: Once the sync nfs_mount() functions is finished we have to clear rpc->connect_cb. Otherwise we get a crash once the connect_cb callback is invoked the second time. --- lib/libnfs-sync.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/libnfs-sync.c b/lib/libnfs-sync.c index 0340eda..bd6048e 100644 --- a/lib/libnfs-sync.c +++ b/lib/libnfs-sync.c @@ -132,6 +132,7 @@ static void mount_cb(int status, struct nfs_context *nfs, void *data, void *priv int nfs_mount(struct nfs_context *nfs, const char *server, const char *export) { struct sync_cb_data cb_data; + struct rpc_context *rpc = nfs_get_rpc_context(nfs); cb_data.is_finished = 0; @@ -142,6 +143,9 @@ int nfs_mount(struct nfs_context *nfs, const char *server, const char *export) wait_for_nfs_reply(nfs, &cb_data); + /* Dont want any more callbacks even if the socket is closed */ + rpc->connect_cb = NULL; + return cb_data.status; } -- 2.34.1