Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 1715b6af in mainline


Ignore:
Timestamp:
2010-01-27T19:29:09Z (11 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
master
Children:
bca408b, f29a3a2
Parents:
e056e820
Message:

nodes_compare() must check the number of passed keys.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/tmpfs/tmpfs_ops.c

    re056e820 r1715b6af  
    160160        tmpfs_node_t *nodep = hash_table_get_instance(item, tmpfs_node_t,
    161161            nh_link);
    162         return (nodep->index == key[NODES_KEY_INDEX] &&
    163             nodep->dev_handle == key[NODES_KEY_DEV]);
     162       
     163        switch (keys) {
     164        case 1:
     165                return (nodep->dev_handle == key[NODES_KEY_DEV]);
     166        case 2:
     167                return ((nodep->dev_handle == key[NODES_KEY_DEV]) &&
     168                    (nodep->index == key[NODES_KEY_INDEX]));
     169        default:
     170                abort();
     171        }
    164172}
    165173
Note: See TracChangeset for help on using the changeset viewer.