viced-deal-gracefully-with-afsconf-failure-20010924
authorNickolai Zeldovich <kolya@mit.edu>
Mon, 24 Sep 2001 11:48:14 +0000 (11:48 +0000)
committerDerrick Brashear <shadow@dementia.org>
Mon, 24 Sep 2001 11:48:14 +0000 (11:48 +0000)
-- Fileserver will complain if afsconf_Open() fails, rather than
    mysteriously segfault'ing later on.

src/viced/viced.c

index 4d7fef1..0280e7b 100644 (file)
@@ -349,6 +349,11 @@ main(argc, argv)
     }
 #endif
     confDir = afsconf_Open(AFSDIR_SERVER_ETC_DIRPATH);
+    if (!confDir) {
+       fprintf(stderr, "Unable to open config directory %s\n",
+               AFSDIR_SERVER_ETC_DIRPATH);
+       exit(-1);
+    }
 
     NewParms(1);