X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fsysusers%2Fsysusers.c;h=647eb577a602671d13fd22426bbbba9d0d23f7ec;hb=4a02e68602be9f6f3caac0f6195672490f715fe1;hp=e69a5f58ad82d9195f8cfc77b17a443672d1c0c5;hpb=56f64d95763a799ba4475daf44d8e9f72a1bd474;p=elogind.git diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c index e69a5f58a..647eb577a 100644 --- a/src/sysusers/sysusers.c +++ b/src/sysusers/sysusers.c @@ -76,7 +76,7 @@ static Hashmap *members = NULL; static Hashmap *database_uid = NULL, *database_user = NULL; static Hashmap *database_gid = NULL, *database_group = NULL; -static uid_t search_uid = (uid_t) -1; +static uid_t search_uid = UID_INVALID; static UidRange *uid_range = NULL; static unsigned n_uid_range = 0; @@ -898,10 +898,8 @@ static int add_user(Item *i) { i->description = strdup(p->pw_gecos); return 0; } - if (!IN_SET(errno, 0, ENOENT)) { - log_error_errno(errno, "Failed to check if user %s already exists: %m", i->name); - return -errno; - } + if (!IN_SET(errno, 0, ENOENT)) + return log_error_errno(errno, "Failed to check if user %s already exists: %m", i->name); /* And shadow too, just to be sure */ errno = 0; @@ -910,10 +908,8 @@ static int add_user(Item *i) { log_error("User %s already exists in shadow database, but not in user database.", i->name); return -EBADMSG; } - if (!IN_SET(errno, 0, ENOENT)) { - log_error_errno(errno, "Failed to check if user %s already exists in shadow database: %m", i->name); - return -errno; - } + if (!IN_SET(errno, 0, ENOENT)) + return log_error_errno(errno, "Failed to check if user %s already exists in shadow database: %m", i->name); } /* Try to use the suggested numeric uid */ @@ -1056,10 +1052,8 @@ static int add_group(Item *i) { i->gid_set = true; return 0; } - if (!IN_SET(errno, 0, ENOENT)) { - log_error_errno(errno, "Failed to check if group %s already exists: %m", i->name); - return -errno; - } + if (!IN_SET(errno, 0, ENOENT)) + return log_error_errno(errno, "Failed to check if group %s already exists: %m", i->name); } /* Try to use the suggested numeric gid */