summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/init.lua b/init.lua
index 593e917..abd0f2f 100644
--- a/init.lua
+++ b/init.lua
@@ -4,13 +4,14 @@ local prose = require'garkup.prose'
function empipe(prog, input)
local posix = require'posix'
+ local unistd = posix.unistd or require'posix.unistd'
local pipe = assert(posix.popen_pipeline({
function() io.write(input) end,
prog
}, "r"))
local output = ""
repeat
- local next = assert(posix.unistd.read(pipe.fd, 8192))
+ local next = assert(unistd.read(pipe.fd, 8192))
output = output .. next
until #next == 0
assert(posix.pclose(pipe))