X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=attribute.c;h=d5f488467e4854f5463d5bf72df3b4f0e2d6cb02;hp=e3bd40b5425261c97bdf3ed31700ac52ae83884e;hb=ba0a963f0a31848e7f622c45c56fa6ebf0b67057;hpb=00ae8d84bfe8872be809617a31fc11a35e145995 diff --git a/attribute.c b/attribute.c index e3bd40b5..d5f48846 100644 --- a/attribute.c +++ b/attribute.c @@ -8,6 +8,7 @@ #include #include +#include #include "para.h" #include "error.h" @@ -149,7 +150,7 @@ static int com_lsatt_callback(struct afs_callback_arg *aca) int ret; struct pattern_match_data pmd = { .table = attribute_table, - .loop_col_num = ATTCOL_BITNUM, + .loop_col_num = ATTCOL_NAME, .match_col_num = ATTCOL_NAME, .patterns = {.data = (char *)aca->query.data + sizeof(flags), .size = aca->query.size - sizeof(flags)}, @@ -158,7 +159,7 @@ static int com_lsatt_callback(struct afs_callback_arg *aca) .action = print_attribute }; if (flags & LSATT_FLAG_SORT_BY_ID) - pmd.loop_col_num = ATTCOL_NAME; + pmd.loop_col_num = ATTCOL_BITNUM; if (flags & LSATT_FLAG_REVERSE) pmd.pm_flags |= PM_REVERSE_LOOP; ret = for_each_matching_row(&pmd); @@ -437,13 +438,13 @@ err: static int att_logical_or(struct osl_row *row, void *data) { - uint64_t *att_mask = data; + uint64_t *att_mask = data, one = 1; struct osl_object bitnum_obj; int ret = osl_get_object(attribute_table, row, ATTCOL_BITNUM, &bitnum_obj); if (ret < 0) return ret; - *att_mask |= 1 << *(unsigned char *)bitnum_obj.data; + *att_mask |= one << *(unsigned char *)bitnum_obj.data; return 0; } @@ -508,7 +509,7 @@ static int attribute_open(const char *dir) return ret; } attribute_table = NULL; - if (ret >= 0 || ret == -OSL_ERRNO_TO_PARA_ERROR(E_OSL_NOENT)) + if (ret == -OSL_ERRNO_TO_PARA_ERROR(E_OSL_NOENT)) return 1; return ret; }