svn commit: r234988 - head/usr.sbin/jail
Jamie Gritton
jamie at FreeBSD.org
Thu May 3 21:39:24 UTC 2012
Author: jamie
Date: Thu May 3 21:39:23 2012
New Revision: 234988
URL: http://svn.freebsd.org/changeset/base/234988
Log:
Add a meta-parameter IP__NULL to enum intparam, instead of mixing
enum values and zeroes. This keeps clang happy (and is just good form).
Submitted by: dim
Modified:
head/usr.sbin/jail/command.c
head/usr.sbin/jail/config.c
head/usr.sbin/jail/jail.c
head/usr.sbin/jail/jailp.h
Modified: head/usr.sbin/jail/command.c
==============================================================================
--- head/usr.sbin/jail/command.c Thu May 3 21:21:45 2012 (r234987)
+++ head/usr.sbin/jail/command.c Thu May 3 21:39:23 2012 (r234988)
@@ -100,7 +100,7 @@ next_command(struct cfjail *j)
if (j->comstring == NULL) {
j->comparam += create_failed ? -1 : 1;
switch ((comparam = *j->comparam)) {
- case 0:
+ case IP__NULL:
return 0;
case IP_MOUNT_DEVFS:
if (!bool_param(j->intparams[IP_MOUNT_DEVFS]))
Modified: head/usr.sbin/jail/config.c
==============================================================================
--- head/usr.sbin/jail/config.c Thu May 3 21:21:45 2012 (r234987)
+++ head/usr.sbin/jail/config.c Thu May 3 21:39:23 2012 (r234988)
@@ -328,7 +328,7 @@ add_param(struct cfjail *j, const struct
}
} else {
flags = PF_APPEND;
- if (ipnum != 0) {
+ if (ipnum != IP__NULL) {
name = intparams[ipnum].name;
flags |= intparams[ipnum].flags;
} else if ((cs = strchr(value, '='))) {
@@ -350,7 +350,7 @@ add_param(struct cfjail *j, const struct
}
/* See if this parameter has already been added. */
- if (ipnum != 0)
+ if (ipnum != IP__NULL)
dp = j->intparams[ipnum];
else
TAILQ_FOREACH(dp, &j->params, tq)
@@ -375,10 +375,10 @@ add_param(struct cfjail *j, const struct
np->flags = flags;
np->gen = 0;
TAILQ_INSERT_TAIL(&j->params, np, tq);
- if (ipnum != 0)
+ if (ipnum != IP__NULL)
j->intparams[ipnum] = np;
else
- for (ipnum = 1; ipnum < IP_NPARAM; ipnum++)
+ for (ipnum = IP__NULL + 1; ipnum < IP_NPARAM; ipnum++)
if (!(intparams[ipnum].flags & PF_CONV) &&
equalopts(name, intparams[ipnum].name)) {
j->intparams[ipnum] = np;
Modified: head/usr.sbin/jail/jail.c
==============================================================================
--- head/usr.sbin/jail/jail.c Thu May 3 21:21:45 2012 (r234987)
+++ head/usr.sbin/jail/jail.c Thu May 3 21:39:23 2012 (r234988)
@@ -81,7 +81,7 @@ static struct permspec perm_sysctl[] = {
};
static const enum intparam startcommands[] = {
- 0,
+ IP__NULL,
#ifdef INET
IP__IP4_IFADDR,
#endif
@@ -97,11 +97,11 @@ static const enum intparam startcommands
IP_EXEC_START,
IP_COMMAND,
IP_EXEC_POSTSTART,
- 0
+ IP__NULL
};
static const enum intparam stopcommands[] = {
- 0,
+ IP__NULL,
IP_EXEC_PRESTOP,
IP_EXEC_STOP,
IP_STOP_TIMEOUT,
@@ -116,7 +116,7 @@ static const enum intparam stopcommands[
#ifdef INET
IP__IP4_IFADDR,
#endif
- 0
+ IP__NULL
};
int
Modified: head/usr.sbin/jail/jailp.h
==============================================================================
--- head/usr.sbin/jail/jailp.h Thu May 3 21:21:45 2012 (r234987)
+++ head/usr.sbin/jail/jailp.h Thu May 3 21:39:23 2012 (r234988)
@@ -71,7 +71,8 @@
#define JF_DO_STOP(js) (((js) & (JF_SET | JF_STOP)) == JF_STOP)
enum intparam {
- IP_ALLOW_DYING = 1, /* Allow making changes to a dying jail */
+ IP__NULL = 0, /* Null command */
+ IP_ALLOW_DYING, /* Allow making changes to a dying jail */
IP_COMMAND, /* Command run inside jail at creation */
IP_DEPEND, /* Jail starts after (stops before) another */
IP_EXEC_CLEAN, /* Run commands in a clean environment */
More information about the svn-src-all
mailing list