summaryrefslogtreecommitdiff
path: root/plugins/New_GPG/src/gpg_wrapper.cpp
diff options
context:
space:
mode:
authorAlexander Gluzsky <sss123next@list.ru>2013-01-06 12:20:59 +0000
committerAlexander Gluzsky <sss123next@list.ru>2013-01-06 12:20:59 +0000
commitd59bd1a4e5cdb03de7ae785411ba2a7f08b72999 (patch)
treec2dd109b45cd52932a534448bd302af0f2c860d2 /plugins/New_GPG/src/gpg_wrapper.cpp
parent9d2297e9b9797e1d5008af1a405330dadd342567 (diff)
debuglog refactoring
more debug info in log git-svn-id: http://svn.miranda-ng.org/main/trunk@2993 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/New_GPG/src/gpg_wrapper.cpp')
-rwxr-xr-xplugins/New_GPG/src/gpg_wrapper.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/plugins/New_GPG/src/gpg_wrapper.cpp b/plugins/New_GPG/src/gpg_wrapper.cpp
index d743af4c8b..b2c65854cf 100755
--- a/plugins/New_GPG/src/gpg_wrapper.cpp
+++ b/plugins/New_GPG/src/gpg_wrapper.cpp
@@ -80,7 +80,7 @@ pxResult pxExecute(wstring *acommandline, char *ainput, string *aoutput, LPDWORD
if(errno == ENOENT)
{
mir_free(bin_path);
- debuglog<<time_str()<<": GPG executable not found\n";
+ debuglog<<std::string(time_str()+": GPG executable not found");
*result = pxNotFound;
return pxNotFound;
}
@@ -100,7 +100,7 @@ pxResult pxExecute(wstring *acommandline, char *ainput, string *aoutput, LPDWORD
mir_free(home_dir);
}
- debuglog<<time_str()<<": gpg in: "<<commandline<<"\n";
+ debuglog<<std::string(time_str()+": gpg in: "+toUTF8(commandline));
success = CreateProcess(NULL, (TCHAR*)commandline.c_str(), NULL, NULL, TRUE, CREATE_NEW_CONSOLE | CREATE_UNICODE_ENVIRONMENT, (void*)_T("LANGUAGE=en@quot\0LC_ALL=English\0"), NULL, &sinfo, &pri);
@@ -142,7 +142,7 @@ pxResult pxExecute(wstring *acommandline, char *ainput, string *aoutput, LPDWORD
fix_line_term(*aoutput);
- debuglog<<time_str()<<": gpg out: "<<aoutput->c_str();
+ debuglog<<std::string(time_str()+": gpg out: "+*aoutput);
WaitForSingleObject(pri.hProcess,INFINITE);
@@ -155,6 +155,11 @@ pxResult pxExecute(wstring *acommandline, char *ainput, string *aoutput, LPDWORD
*result = pxSuccess;
// gpg_mutex.unlock();
+ if(*aexitcode)
+ {
+ debuglog<<std::string(time_str()+": warning: wrong gpg exit status, gpg output: "+*aoutput);
+ return pxSuccessExitCodeInvalid;
+ }
return pxSuccess;
}