afs: Improve error diagnostics.
[paraslash.git] / afs.c
diff --git a/afs.c b/afs.c
index d9cddeb87b356103164bee70ddf2534122c7923a..c4de2e8f37d5a94937f0fe3519715d40242f5329 100644 (file)
--- a/afs.c
+++ b/afs.c
@@ -366,8 +366,8 @@ int for_each_matching_row(struct pattern_match_data *pmd)
  */
 int string_compare(const struct osl_object *obj1, const struct osl_object *obj2)
 {
-       const char *str1 = (const char *)obj1->data;
-       const char *str2 = (const char *)obj2->data;
+       const char *str1 = obj1->data;
+       const char *str2 = obj2->data;
        return strncmp(str1, str2, PARA_MIN(obj1->size, obj2->size));
 }
 
@@ -1043,7 +1043,8 @@ static int com_init_callback(struct afs_callback_arg *aca)
        }
        ret = open_afs_tables();
        if (ret < 0)
-               para_printf(&aca->pbout, "cannot open afs tables\n");
+               para_printf(&aca->pbout, "cannot open afs tables: %s\n",
+                       para_strerror(-ret));
 out:
        return ret;
 }