afscp: enable debugging support in the volume portion
authorDerrick Brashear <shadow@dementix.org>
Wed, 21 Sep 2011 16:55:39 +0000 (12:55 -0400)
committerDerrick Brashear <shadow@dementix.org>
Wed, 21 Sep 2011 17:48:01 +0000 (10:48 -0700)
readd the missing code when we are compiled for debug

Change-Id: Ia4f0bcf2868e2f87bf8f7b6c01f3842e1a2eed50
Reviewed-on: http://gerrit.openafs.org/5483
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

src/libafscp/afscp_volume.c

index 6a0978d..9ff56f0 100644 (file)
@@ -76,8 +76,9 @@ afscp_VolumeByName(struct afscp_cell *cell, const char *vname,
     struct afscp_server *server;
     afs_int32 code, vtype, type, srv;
     void *s;
-    /* struct in_addr i; */
-
+#ifdef AFSCP_DEBUG
+    struct in_addr i;
+#endif
     if (intype == RWVOL)
        vtype = VLSF_RWVOL;
     else if (intype == ROVOL)
@@ -172,11 +173,12 @@ afscp_VolumeByName(struct afscp_cell *cell, const char *vname,
 
     ret->voltype = intype;
     server = afscp_ServerByIndex(ret->servers[0]);
-    /* if (server != NULL)
-     * i.s_addr = server->addrs[0];
-     * else
-     * i.s_addr = 0; */
-    /* i.s_addr is set but not used later */
+#ifdef AFSCP_DEBUG
+    if (server != NULL)
+       i.s_addr = server->addrs[0];
+    else
+       i.s_addr = 0;
+#endif
     afs_dprintf(("New volume BYNAME %s (%lu) on %s (%d)\n", ret->name,
                 afs_printable_uint32_lu(ret->id),
                 inet_ntoa(i), ret->servers[0]));
@@ -200,7 +202,9 @@ afscp_VolumeById(struct afscp_cell *cell, afs_uint32 id)
     int voltype = -1;
     char idbuffer[16];
     void *s;
-    /* struct in_addr i; */
+#ifdef AFSCP_DEBUG
+    struct in_addr i;
+#endif
 
     memset(&key, 0, sizeof(key));
     key.id = id;
@@ -312,11 +316,12 @@ afscp_VolumeById(struct afscp_cell *cell, afs_uint32 id)
     }
     ret->voltype = voltype;
     server = afscp_ServerByIndex(ret->servers[0]);
-    /* if (server)
-     * i.s_addr = server->addrs[0];
-     * else
-     * i.s_addr = 0; */
-    /* i.s_addr is set but not referenced later */
+#ifdef AFSCP_DEBUG
+    if (server)
+       i.s_addr = server->addrs[0];
+    else
+       i.s_addr = 0;
+#endif
     afs_dprintf(("New volume BYID %s (%lu) on %s (%d)\n", ret->name,
                 afs_printable_uint32_lu(ret->id), inet_ntoa(i),
                 ret->servers[0]));