From 5ae74603dadb8fbcb73ff0817b4b656e2b152718 Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Mon, 9 Jun 2008 18:13:09 +0000 Subject: [PATCH] * libmisc/find_new_ids.c: Change find_new_uid() and find_new_gid() prototypes to use a bool for their first argument (sys_user / sys_group). --- ChangeLog | 6 ++++++ libmisc/find_new_ids.c | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3333dc57..d19d2e62 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-06-09 Nicolas François + + * libmisc/find_new_ids.c: Change find_new_uid() and find_new_gid() + prototypes to use a bool for their first argument (sys_user / + sys_group). + 2008-06-09 Nicolas François * libmisc/console.c: Change is_listed() prototype to return a bool. diff --git a/libmisc/find_new_ids.c b/libmisc/find_new_ids.c index 6dbad6c3..523862c8 100644 --- a/libmisc/find_new_ids.c +++ b/libmisc/find_new_ids.c @@ -48,14 +48,14 @@ * * Return 0 on success, -1 if no unused UIDs are available. */ -int find_new_uid (int sys_user, uid_t *uid, uid_t const *preferred_uid) +int find_new_uid (bool sys_user, uid_t *uid, uid_t const *preferred_uid) { const struct passwd *pwd; uid_t uid_min, uid_max, user_id; assert (uid != NULL); - if (sys_user == 0) { + if (!sys_user) { uid_min = getdef_unum ("UID_MIN", 1000); uid_max = getdef_unum ("UID_MAX", 60000); } else { @@ -131,14 +131,14 @@ int find_new_uid (int sys_user, uid_t *uid, uid_t const *preferred_uid) * * Return 0 on success, -1 if no unused GIDs are available. */ -int find_new_gid (int sys_group, gid_t *gid, gid_t const *preferred_gid) +int find_new_gid (bool sys_group, gid_t *gid, gid_t const *preferred_gid) { const struct group *grp; gid_t gid_min, gid_max, group_id; assert (gid != NULL); - if (sys_group == 0) { + if (!sys_group) { gid_min = getdef_unum ("GID_MIN", 1000); gid_max = getdef_unum ("GID_MAX", 60000); } else {