]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
libafscp: Actually return callback from FindCallback
authorSimon Wilkinson <sxw@your-file-system.com>
Tue, 19 Feb 2013 17:53:11 +0000 (17:53 +0000)
committerStephan Wiesand <stephan.wiesand@desy.de>
Wed, 28 Aug 2013 12:47:05 +0000 (05:47 -0700)
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 <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit f67e4a3cdfb1856e31dda0d4741c8d34df13f8fc)

Change-Id: Ia610993535acc68beef7e8cffcfac77db2638aa4
Reviewed-on: http://gerrit.openafs.org/9973
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/libafscp/afscp.h
src/libafscp/afscp_callback.c
src/libafscp/afscp_fid.c

index 21ac77f376674f4413c178ce2fb230d05caefbe4..4634202ef710eb1c4943b23155cf991553c43f8b 100644 (file)
@@ -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 *,
index 08e827de52c2b601d69c355d6674f69c9e45b038..e1f13d7948bd7cfa329233373915e18116e586a5 100644 (file)
@@ -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;
 
index 903d1238e7e9fa3a843a51f98592edabcaa366af..69e38b16456969b4625908cdf76c6a359df5b8af 100644 (file)
@@ -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;