openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/shadow/4.6-r0/shadow-4.6/lib/subordinateio.c
static int subordinate_range_cmp(const void* p1, const void* p2)
{
    struct subordinate_range *range1, *range2;

    if ((*(struct commonio_entry**)p1)->eptr == NULL)
        return 1;
    if ((*(struct commonio_entry**)p2)->eptr == NULL)
        return -1;

    range1 = ((struct subordinate_range*)(*(struct commonio_entry**)p1)->eptr);
    range2 = ((struct subordinate_range*)(*(struct commonio_entry**)p2)->eptr);

    if (range1->start < range2->start)
        return -1;
    else if (range1->start > range2->start)
        return 1;
    else if (range1->count < range2->count)
        return -1;
    else if (range1->count > range2->count)
        return 1;
    else
        return strcmp(range1->owner, range2->owner);
}
/*
 * subordinate_range_cmp: compare uid ranges
 *
 * @p1: pointer to a commonio_entry struct to compare
 * @p2: pointer to second commonio_entry struct to compare
 *
 * Returns 0 if the entries are the same.  Otherwise return -1
 * if the range in p1 is lower than that in p2, or (if the ranges are
 * equal) if the owning uid in p1 is lower than p2's.  Return 1 if p1's
 * range or owning uid is great than p2's.
 */
compare uid ranges
@p1: pointer to a commonio_entry struct to compare
@p2: pointer to second commonio_entry struct to compare

Returns 0 if the entries are the same.  Otherwise return -1
if the range in p1 is lower than that in p2, or (if the ranges are
equal) if the owning uid in p1 is lower than p2's.  Return 1 if p1's
range or owning uid is great than p2's.
compare uid ranges @p1 : pointer to a commonio_entry struct to compare @p2 : pointer to second commonio_entry struct to compare Returns 0 if the entries are the same . Otherwise return - 1 if the range in p1 is lower than that in p2 or ( if the ranges are equal ) if the owning uid in p1 is lower than p2 ' s . Return 1 if p1 ' s range or owning uid is great than p2 ' s .
static int subordinate_range_cmp(const void* p1, const void* p2)
{
    struct subordinate_range *range1, *range2;
    if ((*(struct commonio_entry**)p1)->eptr == NULL)
        return 1;
    if ((*(struct commonio_entry**)p2)->eptr == NULL)
        return -1;
    range1 = ((struct subordinate_range*)(*(struct commonio_entry**)p1)->eptr);
    range2 = ((struct subordinate_range*)(*(struct commonio_entry**)p2)->eptr);
    if (range1->start < range2->start)
        return -1;
    else if (range1->start > range2->start)
        return 1;
    else if (range1->count < range2->count)
        return -1;
    else if (range1->count > range2->count)
        return 1;
    else
        return strcmp(range1->owner, range2->owner);
}
static int subordinate_range_cmp ( const void * p1 , const void * p2 ) { struct subordinate_range * range1 , * range2 ; if ( ( * ( struct commonio_entry * * ) p1 ) -> eptr == NULL ) return 1 ; if ( ( * ( struct commonio_entry * * ) p2 ) -> eptr == NULL ) return -1 ; range1 = ( ( struct subordinate_range * ) ( * ( struct commonio_entry * * ) p1 ) -> eptr ) ; range2 = ( ( struct subordinate_range * ) ( * ( struct commonio_entry * * ) p2 ) -> eptr ) ; if ( range1 -> start < range2 -> start ) return -1 ; else if ( range1 -> start > range2 -> start ) return 1 ; else if ( range1 -> count < range2 -> count ) return -1 ; else if ( range1 -> count > range2 -> count ) return 1 ; else return strcmp ( range1 -> owner , range2 -> owner ) ; }
subordinate_range_cmp: compare uid ranges
 @p1: pointer to a commonio_entry struct to compare
 @p2: pointer to second commonio_entry struct to compare
subordinate_range_cmp : compare uid ranges @p1 : pointer to a commonio_entry struct to compare @p2 : pointer to second commonio_entry struct to compare