runit

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 6b42cc8a79aabf47afc3098d9d909065d5e491dc
parent c900b337e5b3903474aa8d2377fd33547de45542
Author: Gerrit Pape <pape@smarden.org>
Date:   Tue, 26 Jun 2007 09:11:05 +0000

chpst.c: add explicit braces to avoid ambiguous 'else'.

Diffstat:
Mpackage/CHANGES | 1+
Msrc/chpst.c | 6++++--
2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/package/CHANGES b/package/CHANGES @@ -10,6 +10,7 @@ rewording. * doc/useinit.html: add instructions on how to use with upstart (thx Lloyd Zusman). + * chpst.c: add explicit braces to avoid ambiguous 'else'. 1.7.2 Tue, 21 Nov 2006 15:13:47 +0000 diff --git a/src/chpst.c b/src/chpst.c @@ -64,12 +64,13 @@ unsigned int lockdelay; void suidgid(char *user, unsigned int ext) { struct uidgid ugid; - if (ext) + if (ext) { if (! uidgids_get(&ugid, user)) { if (*user == ':') fatalx("invalid uid/gids", user +1); if (errno) fatal("unable to get password/group file entry"); fatalx("unknown user/group", user); } + } else if (! uidgid_get(&ugid, user)) { if (errno) fatal("unable to get password file entry"); @@ -84,12 +85,13 @@ void euidgid(char *user, unsigned int ext) { struct uidgid ugid; char bufnum[FMT_ULONG]; - if (ext) + if (ext) { if (! uidgids_get(&ugid, user)) { if (*user == ':') fatalx("invalid uid/gids", user +1); if (errno) fatal("unable to get password/group file entry"); fatalx("unknown user/group", user); } + } else if (! uidgid_get(&ugid, user)) { if (errno) fatal("unable to get password file entry");