X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=attribute.c;h=e0a7392fdc99d86f6225c5ac43e1ab690e0bce50;hp=694a962bcd27e53788cd64636b3b165396973e6a;hb=c458b9d45e7c6ddda6285fca3797fddff815bd0a;hpb=f1aec8cff93dcd636dffb137cd7bdbd5f3c3dcff diff --git a/attribute.c b/attribute.c index 694a962b..e0a7392f 100644 --- a/attribute.c +++ b/attribute.c @@ -99,11 +99,17 @@ int get_attribute_bitnum_by_name(const char *att_name, unsigned char *bitnum) return 1; } +/** + * Flags used by the lsatt command. + * + * \param \sa com_lsatt(). + */ enum lsatt_flags { /** Whether "-a" was given for the lsatt command. */ LSATT_FLAG_SORT_BY_ID = 1, /** Whether "-l" was given for the lsatt command. */ LSATT_FLAG_LONG = 2, + /** Reverse sort order. */ LSATT_FLAG_REVERSE = 4 }; @@ -356,14 +362,15 @@ static int remove_attribute(struct osl_table *table, struct osl_row *row, const char *name, void *data) { struct remove_attribute_action_data *raad = data; - int ret = osl_del_row(table, row); unsigned char bitnum; + int ret; + ret = get_attribute_bitnum_by_name(name, &bitnum); if (ret < 0) { para_printf(&raad->pb, "%s: %s\n", name, PARA_STRERROR(-ret)); return 1; } - ret = get_attribute_bitnum_by_name(name, &bitnum); + ret = osl_del_row(table, row); if (ret < 0) { para_printf(&raad->pb, "%s: %s\n", name, PARA_STRERROR(-ret)); return 1; @@ -531,7 +538,7 @@ int attribute_init(struct table_info *ti, const char *db) return ret; } attribute_table = NULL; - if (ret == -E_NOENT) + if (ret >= 0 || is_errno(-ret, ENOENT)) return 1; return ret; }