summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2015-10-13 13:45:58 -0300
committerRenato Botelho <renato@netgate.com>2015-10-13 13:45:58 -0300
commite52aa5f667faebee85874ec39c29fa1257dd554f (patch)
treeb08cff1a8d0fb8f667942aca5b9a8be9fb5dca03 /sbin
parent945ed01c4bae06169f63978e43029c04d4abd731 (diff)
parent8096b85f202b18e1be6a5dd5251a10fcdb255a78 (diff)
downloadFreeBSD-src-e52aa5f667faebee85874ec39c29fa1257dd554f.zip
FreeBSD-src-e52aa5f667faebee85874ec39c29fa1257dd554f.tar.gz
Merge branch 'stable/10' into devel
Diffstat (limited to 'sbin')
-rw-r--r--sbin/init/init.c14
-rw-r--r--sbin/ipfw/ipfw2.c2
2 files changed, 15 insertions, 1 deletions
diff --git a/sbin/init/init.c b/sbin/init/init.c
index 99041c9..e6f567c 100644
--- a/sbin/init/init.c
+++ b/sbin/init/init.c
@@ -1499,6 +1499,15 @@ static state_func_t
death(void)
{
session_t *sp;
+ int block, blocked;
+ size_t len;
+
+ /* Temporarily block suspend. */
+ len = sizeof(blocked);
+ block = 1;
+ if (sysctlbyname("kern.suspend_blocked", &blocked, &len,
+ &block, sizeof(block)) == -1)
+ blocked = 0;
/*
* Also revoke the TTY here. Because runshutdown() may reopen
@@ -1515,6 +1524,11 @@ death(void)
/* Try to run the rc.shutdown script within a period of time */
runshutdown();
+ /* Unblock suspend if we blocked it. */
+ if (!blocked)
+ sysctlbyname("kern.suspend_blocked", NULL, NULL,
+ &blocked, sizeof(blocked));
+
return (state_func_t) death_single;
}
diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c
index 8cc92e1..11ccb9f 100644
--- a/sbin/ipfw/ipfw2.c
+++ b/sbin/ipfw/ipfw2.c
@@ -3001,7 +3001,7 @@ ipfw_add(char *av[])
action->opcode = O_NAT;
action->len = F_INSN_SIZE(ipfw_insn_nat);
CHECK_ACTLEN;
- if (_substrcmp(*av, "global") == 0) {
+ if (*av != NULL && _substrcmp(*av, "global") == 0) {
action->arg1 = 0;
av++;
break;
OpenPOWER on IntegriCloud