From: Simon Wilkinson Date: Tue, 19 Feb 2013 17:53:11 +0000 (+0000) Subject: libafscp: Actually return callback from FindCallback X-Git-Tag: upstream/1.6.6_pre2^2~132 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=2d3ae77f9f26f64c88415a2e063e28c2cebeed1c;p=packages%2Fo%2Fopenafs.git libafscp: Actually return callback from FindCallback Fix FindCallback so that it actually returns the callback that it found. This requires changing the function prototype so that the third parameter is passed by reference, and updating the single call site. Caught by clang-analyzer Reviewed-on: http://gerrit.openafs.org/9198 Reviewed-by: Derrick Brashear Tested-by: BuildBot (cherry picked from commit f67e4a3cdfb1856e31dda0d4741c8d34df13f8fc) Change-Id: Ia610993535acc68beef7e8cffcfac77db2638aa4 Reviewed-on: http://gerrit.openafs.org/9973 Tested-by: BuildBot Reviewed-by: Andrew Deason Reviewed-by: Derrick Brashear Reviewed-by: Stephan Wiesand --- diff --git a/src/libafscp/afscp.h b/src/libafscp/afscp.h index 21ac77f37..4634202ef 100644 --- a/src/libafscp/afscp.h +++ b/src/libafscp/afscp.h @@ -131,7 +131,7 @@ int afscp_CheckCallBack(const struct afscp_venusfid *fid, afs_uint32 *expiretime); int afscp_FindCallBack(const struct afscp_venusfid *f, const struct afscp_server *server, - struct afscp_callback *ret); + struct afscp_callback **ret); int afscp_AddCallBack(const struct afscp_server *, const struct AFSFid *, const struct AFSFetchStatus *, diff --git a/src/libafscp/afscp_callback.c b/src/libafscp/afscp_callback.c index 08e827de5..e1f13d794 100644 --- a/src/libafscp/afscp_callback.c +++ b/src/libafscp/afscp_callback.c @@ -103,7 +103,9 @@ init_afs_cb(void) } /* init_afs_cb */ int -afscp_FindCallBack(const struct afscp_venusfid *f, const struct afscp_server *server, struct afscp_callback *ret) +afscp_FindCallBack(const struct afscp_venusfid *f, + const struct afscp_server *server, + struct afscp_callback **ret) { int i; struct afscp_callback *use = NULL, *cb; @@ -137,7 +139,7 @@ afscp_FindCallBack(const struct afscp_venusfid *f, const struct afscp_server *se } if (use->valid) - ret = use; + *ret = use; else return -1; diff --git a/src/libafscp/afscp_fid.c b/src/libafscp/afscp_fid.c index 903d1238e..69e38b164 100644 --- a/src/libafscp/afscp_fid.c +++ b/src/libafscp/afscp_fid.c @@ -280,7 +280,7 @@ afscp_CheckCallBack(const struct afscp_venusfid *fid, const struct afscp_server if (code != 0) return code; - code = afscp_FindCallBack(fid, server, cb); + code = afscp_FindCallBack(fid, server, &cb); if (code != 0) return code;