]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - attribute.c
Let afs callbacks return an error code.
[paraslash.git] / attribute.c
index 0c23addf3228fb753f5ded3b49dafb45f4d5823e..7da525eb90c7f6feef5a8af631e2be06e4b38dca 100644 (file)
@@ -149,7 +149,7 @@ static int print_attribute(struct osl_table *table, struct osl_row *row,
        return 1;
 }
 
-static void com_lsatt_callback(int fd, const struct osl_object *query)
+static int com_lsatt_callback(int fd, const struct osl_object *query)
 {
        struct lsatt_action_data laad = {
                .flags = *(unsigned *) query->data,
@@ -179,6 +179,7 @@ static void com_lsatt_callback(int fd, const struct osl_object *query)
                pmd.pm_flags |= PM_REVERSE_LOOP;
        for_each_matching_row(&pmd);
        flush_and_free_pb(&laad.pb);
+       return 0;
 }
 
 int com_lsatt(struct command_context *cc)
@@ -223,7 +224,7 @@ struct addatt_event_data {
 };
 
 
-static void com_addatt_callback(int fd, const struct osl_object *query)
+static int com_addatt_callback(int fd, const struct osl_object *query)
 {
        char *p;
        int ret = 1;
@@ -285,6 +286,7 @@ out:
        if (ret < 0)
                para_printf(&pb, "%s: %s\n", p, para_strerror(-ret));
        flush_and_free_pb(&pb);
+       return 0;
 }
 
 int com_addatt(struct command_context *cc)
@@ -300,7 +302,7 @@ int com_addatt(struct command_context *cc)
        return ret;
 }
 
-static void com_mvatt_callback(int fd, const struct osl_object *query)
+static int com_mvatt_callback(int fd, const struct osl_object *query)
 {
        char *old = query->data;
        size_t size = strlen(old) + 1;
@@ -329,6 +331,7 @@ out:
        else
                afs_event(ATTRIBUTE_RENAME, &pb, NULL);
        flush_and_free_pb(&pb);
+       return 0;
 }
 
 int com_mvatt(struct command_context *cc)
@@ -379,7 +382,7 @@ static int remove_attribute(struct osl_table *table, struct osl_row *row,
        return 1;
 }
 
-static void com_rmatt_callback(int fd, const struct osl_object *query)
+static int com_rmatt_callback(int fd, const struct osl_object *query)
 {
        struct remove_attribute_action_data raad = {
                .num_removed = 0,
@@ -407,6 +410,7 @@ static void com_rmatt_callback(int fd, const struct osl_object *query)
        else if (!raad.num_removed)
                para_printf(&raad.pb, "no match -- nothing removed\n");
        flush_and_free_pb(&raad.pb);
+       return 0;
 }
 
 int com_rmatt(struct command_context *cc)