vlserver: Use com_err for Ubik error messages
authorSimon Wilkinson <sxw@your-file-system.com>
Sat, 11 Sep 2010 07:25:15 +0000 (08:25 +0100)
committerDerrick Brashear <shadow@dementia.org>
Mon, 13 Sep 2010 22:11:16 +0000 (15:11 -0700)
Use com_err to return a sensible string, rather than just an error code,
for errors with Ubik initialisation.

This has the specific benefit that the error when the database directory
doesn't exist, or isn't readable, becomes

    Ubik init failed: file not found when processing dbase"
rather than
    Ubik init failed with code 5382

Change-Id: I5f770377668a7f545cad7e422f28afd7c9f9888d
Reviewed-on: http://gerrit.openafs.org/2735
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

src/vlserver/vlserver.c

index 67bad77..dfcd981 100644 (file)
@@ -46,6 +46,7 @@
 #include <afs/keys.h>
 #include <afs/auth.h>
 #include <afs/audit.h>
+#include <afs/com_err.h>
 #include <lock.h>
 #include <ubik.h>
 #include <afs/afsutil.h>
@@ -354,7 +355,7 @@ main(int argc, char **argv)
        ubik_ServerInitByInfo(myHost, htons(AFSCONF_VLDBPORT), &info, clones,
                              vl_dbaseName, &VL_dbase);
     if (code) {
-       printf("vlserver: Ubik init failed with code %d\n", code);
+       printf("vlserver: Ubik init failed: %s\n", afs_error_message(code));
        exit(2);
     }
     if (!rxJumbograms) {