]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - attribute.c
Fix table init.
[paraslash.git] / attribute.c
index 9a7cb45ae88a411f31fa58a3128687fc4e11ea9f..801d907ab714b254dae7415d21ccc6c675484835 100644 (file)
@@ -10,7 +10,7 @@
 #include "string.h"
 #include "net.h"
 
-static void *attribute_table;
+static struct osl_table *attribute_table;
 static int greatest_att_bitnum;
 
 /** The columns of the attribute table. */
@@ -320,7 +320,7 @@ static int com_addatt_callback(const struct osl_object *query,
        if (ret < 0)
                return ret;
        find_greatest_att_bitnum();
-       return mood_reload(); /* FIXME: mood_reload() returns an error */
+       return reload_current_mood(); /* FIXME: mood_reload() returns an error */
 }
 
 int com_addatt(__a_unused int fd, int argc, char * const * const argv)
@@ -355,14 +355,14 @@ static int com_rmatt_callback(const struct osl_object *query,
        find_greatest_att_bitnum();
        if (!atts_removed)
                return 1;
-       return mood_reload(); /* FIXME: Fix mood_reload() */
+       return reload_current_mood();
 }
 
 int com_rmatt(__a_unused int fd, int argc, char * const * const argv)
 {
        if (argc < 2)
                return -E_ATTR_SYNTAX;
-       return send_standard_callback_request(argc, argv, com_rmatt_callback,
+       return send_standard_callback_request(argc - 1, argv + 1, com_rmatt_callback,
                NULL);
 }
 
@@ -466,10 +466,9 @@ int attribute_init(struct table_info *ti, const char *db)
 
        attribute_table_desc.dir = db;
        ti->desc = &attribute_table_desc;
-       ret = osl_open_table(ti->desc, &ti->table);
+       ret = osl_open_table(ti->desc, &attribute_table);
        greatest_att_bitnum = -1; /* no atts available */
        if (ret >= 0) {
-               attribute_table = ti->table;
                find_greatest_att_bitnum();
                return ret;
        }