From owner-svn-src-head@FreeBSD.ORG Thu May 3 21:39:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 089A0106564A; Thu, 3 May 2012 21:39:24 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E7BE78FC0A; Thu, 3 May 2012 21:39:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q43LdNXa064491; Thu, 3 May 2012 21:39:23 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q43LdNGa064486; Thu, 3 May 2012 21:39:23 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201205032139.q43LdNGa064486@svn.freebsd.org> From: Jamie Gritton Date: Thu, 3 May 2012 21:39:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234988 - head/usr.sbin/jail X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 May 2012 21:39:24 -0000 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 */