Commit 1b981539 authored by Franco Fichtner's avatar Franco Fichtner

src: better posix replacement; fixes #140

parent 38cae64c
......@@ -1303,7 +1303,7 @@ function interface_bring_down($interface = "wan", $destroy = false, $ifacecfg =
case "dhcp6":
$pidv6 = find_dhcp6c_process($realif);
if ($pidv6) {
killbypid($pidv6);
exec('/bin/kill ' . $pidv6);
}
sleep(3);
unlink_if_exists("{$g['varetc_path']}/dhcp6c_{$interface}.conf");
......@@ -2794,7 +2794,7 @@ function kill_dhclient_process($interface)
while ((($pid = find_dhclient_process($interface)) != 0) && ($i < 3)) {
/* 3rd time make it die for sure */
$sig = ($i == 2 ? 'KILL' : 'TERM');
killbypid($pid, $sig);
exec(sprintf('/bin/kill -%s %s', $sig, $pid));
sleep(1);
$i++;
}
......@@ -3227,7 +3227,7 @@ function interface_track6_configure($interface = "lan", $wancfg, $linkupevent =
$parentrealif = get_real_interface($wancfg['track6-interface']);
$pidv6 = find_dhcp6c_process($parentrealif);
if ($pidv6) {
killbypid($pidv6, 'HUP');
exec('/bin/kill -HUP ' . $pidv6);
}
}
break;
......
......@@ -780,9 +780,8 @@ function is_serial_enabled()
function reload_ttys()
{
/* Send a HUP signal to init will make it reload /etc/ttys */
require_once('util.inc');
killbypid(1, 'HUP');
/* force init(8) to reload /etc/ttys */
exec('/bin/kill -HUP 1');
}
/* DHCP enabled on any interfaces? */
......
......@@ -38,7 +38,6 @@ require_once("filter.inc");
require_once("shaper.inc");
require_once("rrd.inc");
require_once("vpn.inc");
require_once("util.inc");
require_once("xmlparse_attr.inc");
$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/interfaces.php');
......@@ -802,7 +801,7 @@ if ($_POST['apply']) {
if ($wancfg['ipaddrv6'] == "dhcp6") {
$pid = find_dhcp6c_process($wancfg['if']);
if ($pid) {
killbypid($pid);
exec('/bin/kill ' . $pid);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment