Remove some system errors from errno.h
[paraslash.git] / attribute.c
index 694a962bcd27e53788cd64636b3b165396973e6a..e0a7392fdc99d86f6225c5ac43e1ab690e0bce50 100644 (file)
@@ -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;
 }