ret = get_attribute_bitnum_by_name(name, &red.bitnum);
if (ret < 0) {
para_printf(&raad->pb, "%s: %s\n", name, para_strerror(-ret));
- return 0;
+ return ret;
}
ret = osl(osl_del_row(table, row));
if (ret < 0) {
para_printf(&raad->pb, "%s: %s\n", name, para_strerror(-ret));
- return 0;
+ return ret;
}
para_printf(&raad->pb, "removed attribute %s\n", name);
raad->num_removed++;
.action = remove_attribute
};
ret = for_each_matching_row(&pmd);
- if (ret < 0)
+ if (ret < 0) {
para_printf(&raad.pb, "%s\n", para_strerror(-ret));
- else if (!raad.num_removed)
- para_printf(&raad.pb, "no match -- nothing removed\n");
+ goto out;
+ }
+ if (!raad.num_removed)
+ ret = -E_NO_MATCH;
+out:
flush_and_free_pb(&raad.pb);
- return 0;
+ return ret;
}
int com_rmatt(struct command_context *cc)
{
- int ret;
-
if (cc->argc < 2)
return -E_ATTR_SYNTAX;
- ret = send_standard_callback_request(cc->argc - 1, cc->argv + 1,
+ return send_standard_callback_request(cc->argc - 1, cc->argv + 1,
com_rmatt_callback, afs_cb_result_handler, cc);
- if (ret < 0)
- send_strerror(cc, -ret);
- return ret;
}
/**