mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
setlogincontext(): Comply to style(9)
Remove indentation by inverting the big 'if (lc)' and using 'return'. Use explicit binary operators to produce booleans. Reviewed by: emaste, kib, dchagin Approved by: emaste (mentor) MFC after: 3 days Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40346
This commit is contained in:
parent
ea9bd44810
commit
771d5c93ab
|
@ -430,23 +430,28 @@ setclassumask(login_cap_t *lc, const struct passwd *pwd)
|
||||||
static void
|
static void
|
||||||
setlogincontext(login_cap_t *lc, const struct passwd *pwd, unsigned long flags)
|
setlogincontext(login_cap_t *lc, const struct passwd *pwd, unsigned long flags)
|
||||||
{
|
{
|
||||||
if (lc) {
|
if (lc == NULL)
|
||||||
/* Set resources */
|
return;
|
||||||
if (flags & LOGIN_SETRESOURCES)
|
|
||||||
setclassresources(lc);
|
/* Set resources. */
|
||||||
/* See if there's a umask override */
|
if ((flags & LOGIN_SETRESOURCES) != 0)
|
||||||
if (flags & LOGIN_SETUMASK)
|
setclassresources(lc);
|
||||||
setclassumask(lc, pwd);
|
|
||||||
/* Set paths */
|
/* See if there's a umask override. */
|
||||||
if (flags & LOGIN_SETPATH)
|
if ((flags & LOGIN_SETUMASK) != 0)
|
||||||
setclassenvironment(lc, pwd, 1);
|
setclassumask(lc, pwd);
|
||||||
/* Set environment */
|
|
||||||
if (flags & LOGIN_SETENV)
|
/* Set paths. */
|
||||||
setclassenvironment(lc, pwd, 0);
|
if ((flags & LOGIN_SETPATH) != 0)
|
||||||
/* Set cpu affinity */
|
setclassenvironment(lc, pwd, 1);
|
||||||
if (flags & LOGIN_SETCPUMASK)
|
|
||||||
setclasscpumask(lc);
|
/* Set environment. */
|
||||||
}
|
if ((flags & LOGIN_SETENV) != 0)
|
||||||
|
setclassenvironment(lc, pwd, 0);
|
||||||
|
|
||||||
|
/* Set cpu affinity. */
|
||||||
|
if ((flags & LOGIN_SETCPUMASK) != 0)
|
||||||
|
setclasscpumask(lc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue