diff -Naurp --exclude ports_local.c --exclude-from excludes old/libsemanage/src/fcontext_record.c new/libsemanage/src/fcontext_record.c --- old/libsemanage/src/fcontext_record.c 2006-01-06 09:36:30.000000000 -0500 +++ new/libsemanage/src/fcontext_record.c 2006-01-06 11:27:40.000000000 -0500 @@ -81,8 +81,18 @@ int semanage_fcontext_compare( const semanage_fcontext_t* fcontext, const semanage_fcontext_key_t* key) { - return strcmp(fcontext->expr, key->expr) && - (fcontext->type == key->type); + int rv = strcmp(fcontext->expr, key->expr); + if (rv != 0) + return rv; + else { + if (fcontext->type < key->type) + return -1; + + else if (key->type < fcontext->type) + return 1; + + else return 0; + } } hidden_def(semanage_fcontext_compare) @@ -90,8 +100,18 @@ int semanage_fcontext_compare2( const semanage_fcontext_t* fcontext, const semanage_fcontext_t* fcontext2) { - return strcmp(fcontext->expr, fcontext2->expr) && - (fcontext->type == fcontext2->type); + int rv = strcmp(fcontext->expr, fcontext2->expr); + if (rv != 0) + return rv; + else { + if (fcontext->type < fcontext2->type) + return -1; + + else if (fcontext2->type < fcontext->type) + return 1; + + else return 0; + } } hidden_def(semanage_fcontext_compare2)