aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xawall-cli21
1 files changed, 12 insertions, 9 deletions
diff --git a/awall-cli b/awall-cli
index a305c26..f0ec1c7 100755
--- a/awall-cli
+++ b/awall-cli
@@ -8,7 +8,10 @@ See LICENSE file for license details
get_opts = require('alt_getopt').get_opts
lpc = require('lpc')
-signal = require('signal')
+
+posix = require('posix')
+signal = posix.signal
+
stringy = require('stringy')
function help()
@@ -276,7 +279,7 @@ if not call(
if mode == 'dump' then dump(level)
elseif mode == 'diff' then
- if not require('posix').stat(dumpfile) then
+ if not posix.stat(dumpfile) then
io.stderr:write('Please translate or activate first\n')
os.exit(1)
end
@@ -304,15 +307,15 @@ if not call(
local pid, interrupted
if not force then
- signal.signal(
- 'SIGCHLD',
+ signal(
+ posix.SIGCHLD,
function()
if pid and lpc.wait(pid, 1) then os.exit(2) end
end
)
for i, sig in ipairs({'INT', 'TERM'}) do
- signal.signal(
- 'SIG'..sig,
+ signal(
+ posix['SIG'..sig],
function()
interrupted = true
io.stdin:close()
@@ -327,8 +330,8 @@ if not call(
end
local function kill()
- signal.signal('SIGCHLD', 'default')
- signal.kill(pid, 'SIGTERM')
+ signal(posix.SIGCHLD, 'SIG_DFL')
+ posix.kill(pid, posix.SIGTERM)
lpc.wait(pid)
end
@@ -366,7 +369,7 @@ if not call(
elseif mode == 'fallback' then
for i, sig in ipairs({'HUP', 'PIPE'}) do
- signal.signal('SIG'..sig, function() end)
+ signal(posix['SIG'..sig], 'SIG_IGN')
end
require('lsleep').sleep(10)