X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=attribute.c;h=4cb2982860de78dd26b9fc55ad552c73a7ca1b9f;hp=e3bd40b5425261c97bdf3ed31700ac52ae83884e;hb=7eaf2faf618705c97c77750371e177108aaa5897;hpb=00ae8d84bfe8872be809617a31fc11a35e145995 diff --git a/attribute.c b/attribute.c index e3bd40b5..4cb29828 100644 --- a/attribute.c +++ b/attribute.c @@ -149,7 +149,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 +158,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 +437,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 +508,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; }