summaryrefslogtreecommitdiff
path: root/gpg_wrapper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gpg_wrapper.cpp')
-rw-r--r--gpg_wrapper.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/gpg_wrapper.cpp b/gpg_wrapper.cpp
index 3091566..b85d24b 100644
--- a/gpg_wrapper.cpp
+++ b/gpg_wrapper.cpp
@@ -18,12 +18,12 @@
//thx gpg module from Harald Treder, Zakhar V. Bardymov
-boost::mutex gpg_mutex;
+//boost::mutex gpg_mutex;
pxResult pxExecute(wstring *acommandline, char *ainput, string *aoutput, LPDWORD aexitcode, pxResult *result)
{
- gpg_mutex.lock();
+// gpg_mutex.lock();
if(!gpg_configured)
return pxNotConfigured;
extern logtofile debuglog;
@@ -80,6 +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";
*result = pxNotFound;
return pxNotFound;
}
@@ -99,7 +100,7 @@ pxResult pxExecute(wstring *acommandline, char *ainput, string *aoutput, LPDWORD
delete [] home_dir;
}
- debuglog<<time_str()<<": gpg in: "<<commandline;
+ debuglog<<time_str()<<": gpg in: "<<commandline<<"\n";
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);
@@ -110,7 +111,8 @@ pxResult pxExecute(wstring *acommandline, char *ainput, string *aoutput, LPDWORD
CloseHandle(writestdin);
CloseHandle(newstdout);
CloseHandle(readstdout);
- gpg_mutex.unlock();
+ debuglog<<time_str()<<": Failed to create process\n";
+// gpg_mutex.unlock();
*result = pxCreateProcessFailed;
return pxCreateProcessFailed;
}
@@ -147,7 +149,7 @@ pxResult pxExecute(wstring *acommandline, char *ainput, string *aoutput, LPDWORD
CloseHandle(writestdin);
*result = pxSuccess;
- gpg_mutex.unlock();
+// gpg_mutex.unlock();
return pxSuccess;
}
@@ -155,8 +157,4 @@ void pxEexcute_thread(void *param)
{
gpg_execution_params *params = (gpg_execution_params*)param;
pxResult result = pxExecute(params->cmd, params->useless, params->out, params->code, params->result);
- if(result == pxNotFound)
- {
- debuglog<<time_str()<<": Gpg binary not found";
- }
}