viced: Catch GetCellInfo failure
authorSimon Wilkinson <sxw@your-file-system.com>
Fri, 22 Feb 2013 10:20:58 +0000 (10:20 +0000)
committerJeffrey Altman <jaltman@your-file-system.com>
Sun, 24 Feb 2013 19:41:16 +0000 (11:41 -0800)
If GetCellInfo returns a non-zero result, catch the error, rather
than just carrying on regardless.

Caught by clang-analyzer

Change-Id: I6b9ca91c8cea2ff0d68873913abdc0daadcc0e27
Reviewed-on: http://gerrit.openafs.org/9240
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

src/viced/viced.c

index cd5c230..4abbb4a 100644 (file)
@@ -1508,6 +1508,11 @@ vl_Initialize(struct afsconf_dir *dir)
        exit(1);
     }
     code = afsconf_GetCellInfo(dir, NULL, AFSCONF_VLDBSERVICE, &info);
+    if (code) {
+       ViceLog(0,
+               ("vl_Initialize: Failed to get cell information\n"));
+       exit(1);
+    }
     if (info.numServers > MAXSERVERS) {
        ViceLog(0,
                ("vl_Initialize: info.numServers=%d (> MAXSERVERS=%d)\n",