Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions pws
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ class GnuPG
end

def GnuPG.open3call(cmd, intxt, args, require_success = false, do_status=true)
inR, inW = IO.pipe
outR, outW = IO.pipe
errR, errW = IO.pipe
statR, statW = IO.pipe if do_status
inR, inW = IO.pipe.each { |fd| fd.close_on_exec = false }
outR, outW = IO.pipe.each { |fd| fd.close_on_exec = false }
errR, errW = IO.pipe.each { |fd| fd.close_on_exec = false }
statR, statW = IO.pipe.each { |fd| fd.close_on_exec = false } if do_status
opt_statusfd, opt_output, arg_input = nil, nil, nil
inO = $stdin
outO = $stdout
Expand All @@ -104,7 +104,7 @@ class GnuPG
STDOUT.reopen(outW)
STDERR.reopen(errW)
begin
exec(*fullcmd)
exec(*fullcmd, :close_others => false)
rescue Exception => e
outW.puts("[PWSEXECERROR]: #{e}")
exit(1)
Expand Down