fixup! gluon-core: implement popen3() in gluon/util.lua
This commit is contained in:
		
							parent
							
								
									d513d001f4
								
							
						
					
					
						commit
						98efb82ec0
					
				@ -241,12 +241,12 @@ function M.subprocess.popen(path, argt, options)
 | 
				
			|||||||
			null = posix_fcntl.open('/dev/null', posix_fcntl.O_RDWR)
 | 
								null = posix_fcntl.open('/dev/null', posix_fcntl.O_RDWR)
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		for iostream in pairs(stdiostreams) do
 | 
							for iostream, fd in pairs(stdiostreams) do
 | 
				
			||||||
			local option = options[iostream]
 | 
								local option = options[iostream]
 | 
				
			||||||
			if option == M.subprocess.DEVNULL then
 | 
								if option == M.subprocess.DEVNULL then
 | 
				
			||||||
				posix_unistd.dup2(null, stdiostreams[iostream])
 | 
									posix_unistd.dup2(null, fd)
 | 
				
			||||||
			elseif option == M.subprocess.PIPE then
 | 
								elseif option == M.subprocess.PIPE then
 | 
				
			||||||
				posix_unistd.dup2(childfds[iostream], stdiostreams[iostream])
 | 
									posix_unistd.dup2(childfds[iostream], fd)
 | 
				
			||||||
			end
 | 
								end
 | 
				
			||||||
			close_fds(childfds, parentfds)
 | 
								close_fds(childfds, parentfds)
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user