fixup! fixup! gluon-core: implement popen3() in gluon/util.lua

This commit is contained in:
aiyion.prime 2021-07-15 11:17:06 +02:00
parent 98efb82ec0
commit 3c206e85be

View File

@ -246,9 +246,11 @@ function M.subprocess.popen(path, argt, options)
if option == M.subprocess.DEVNULL then if option == M.subprocess.DEVNULL then
posix_unistd.dup2(null, fd) posix_unistd.dup2(null, fd)
elseif option == M.subprocess.PIPE then elseif option == M.subprocess.PIPE then
-- only close these, if they exist
posix_unistd.close(parentfds[iostream])
posix_unistd.dup2(childfds[iostream], fd) posix_unistd.dup2(childfds[iostream], fd)
posix_unistd.close(childfds[iostream])
end end
close_fds(childfds, parentfds)
end end
-- close potential null -- close potential null