util-admin-64bit-20050705
[openafs.git] / src / libadmin / adminutil / afs_utilAdmin.c
index c29e3d4..e04c0aa 100644 (file)
@@ -446,17 +446,19 @@ util_AdminServerAddressGetFromName(const char *serverName, int *serverAddress,
     if (num_converted == 4) {
        *serverAddress = (part1 << 24) | (part2 << 16) | (part3 << 8) | part4;
     } else {
-       LOCK_GLOBAL_MUTEX server = gethostbyname(serverName);
+       LOCK_GLOBAL_MUTEX;
+       server = gethostbyname(serverName);
        if (server != NULL) {
            memcpy((void *)serverAddress, (const void *)server->h_addr,
-                  sizeof(serverAddress));
+                  sizeof(int));
            *serverAddress = ntohl(*serverAddress);
        } else {
            tst = ADMUTILCANTGETSERVERNAME;
            UNLOCK_GLOBAL_MUTEX;
            goto fail_util_AdminServerAddressGetFromName;
        }
-    UNLOCK_GLOBAL_MUTEX}
+       UNLOCK_GLOBAL_MUTEX;
+    }
     rc = 1;
 
   fail_util_AdminServerAddressGetFromName: