summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorAlexander Gluzsky <sss123next@list.ru>2013-03-04 00:36:29 +0000
committerAlexander Gluzsky <sss123next@list.ru>2013-03-04 00:36:29 +0000
commitbc256df33a57e585367edffe33d3e58d53f82ce8 (patch)
treec849c997b0747df3645429905a5f620274c42e27 /plugins
parent709476217c1a8240f06bb8d8cb621f3a8cc01128 (diff)
fixed retrieving exit code from gpg process
git-svn-id: http://svn.miranda-ng.org/main/trunk@3879 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/New_GPG/src/gpg_wrapper.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/New_GPG/src/gpg_wrapper.cpp b/plugins/New_GPG/src/gpg_wrapper.cpp
index 598537a2ca..112d86080f 100755
--- a/plugins/New_GPG/src/gpg_wrapper.cpp
+++ b/plugins/New_GPG/src/gpg_wrapper.cpp
@@ -71,6 +71,7 @@ pxResult pxExecute(std::vector<std::wstring> &aargv, string *aoutput, LPDWORD ae
pipe pout = create_pipe();
pipe perr = create_pipe();
+ child *c = nullptr;
{
file_descriptor_sink sout(pout.sink, close_handle);
file_descriptor_sink serr(perr.sink, close_handle);
@@ -78,8 +79,8 @@ pxResult pxExecute(std::vector<std::wstring> &aargv, string *aoutput, LPDWORD ae
char *mir_path = new char [MAX_PATH];
PathToAbsolute("\\", mir_path);
- child c = execute(set_args(argv), bind_stdout(sout), bind_stderr(serr), close_stdin(),/*bind_stdin(sin),*/ show_window(SW_HIDE), hide_console(), inherit_env(), set_env(env), start_in_dir(toUTF16(mir_path)));
- _child = &c;
+ c = new child(execute(set_args(argv), bind_stdout(sout), bind_stderr(serr), close_stdin(),/*bind_stdin(sin),*/ show_window(SW_HIDE), hide_console(), inherit_env(), set_env(env), start_in_dir(toUTF16(mir_path))));
+ _child = c;
delete [] mir_path;
}
@@ -126,8 +127,9 @@ pxResult pxExecute(std::vector<std::wstring> &aargv, string *aoutput, LPDWORD ae
if(bDebugLog)
debuglog<<std::string(time_str()+": gpg out: "+*aoutput);
-// auto ec = wait_for_exit(*_child);
- *aexitcode = 0;
+ auto ec = wait_for_exit(*c);
+ delete c;
+ *aexitcode = ec;
_child = nullptr;