From 12d2f3a25273a315217a4e79eff6c55c7c93220d Mon Sep 17 00:00:00 2001 From: "aiyion.prime" Date: Tue, 6 Jul 2021 11:07:51 +0200 Subject: [PATCH] fixup! gluon-core: implement popen3() in gluon/util.lua --- package/gluon-core/luasrc/usr/lib/lua/gluon/util.lua | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/package/gluon-core/luasrc/usr/lib/lua/gluon/util.lua b/package/gluon-core/luasrc/usr/lib/lua/gluon/util.lua index 92e621ff..5ad60bc4 100644 --- a/package/gluon-core/luasrc/usr/lib/lua/gluon/util.lua +++ b/package/gluon-core/luasrc/usr/lib/lua/gluon/util.lua @@ -199,19 +199,18 @@ M.PipePolicies = { -- Execute a program found using command PATH search, like the shell. -- Return the pid, as well as the I/O streams as pipes or nil on error. function M.popen3(policies, path, ...) - local pipes = {} local intern = {} local extern = {} for fd, policy in pairs(policies) do if M.PipePolicies.CREATE==policy then - pipes[fd]={posix_unistd.pipe()} + local piper, pipew = posix_unistd.pipe() if posix_unistd.STDIN_FILENO==fd then - intern[fd]=pipes[fd][1] - extern[fd]=pipes[fd][2] + intern[fd]=piper + extern[fd]=pipew else - intern[fd]=pipes[fd][2] - extern[fd]=pipes[fd][1] + intern[fd]=pipew + extern[fd]=piper end end end