[Gpa-commits] r727 - trunk/src
scm-commit at wald.intevation.org
scm-commit at wald.intevation.org
Sat Dec 31 04:48:31 CET 2005
Author: marcus
Date: 2005-12-31 04:48:30 +0100 (Sat, 31 Dec 2005)
New Revision: 727
Modified:
trunk/src/ChangeLog
trunk/src/gpgmetools.c
Log:
2005-12-31 Marcus Brinkmann <marcus at g10code.de>
* gpgmetools.c (gpa_passphrase_cb) [G_OS_WIN32]: Use WriteFile
instead of write.
Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog 2005-11-29 09:07:32 UTC (rev 726)
+++ trunk/src/ChangeLog 2005-12-31 03:48:30 UTC (rev 727)
@@ -1,3 +1,8 @@
+2005-12-31 Marcus Brinkmann <marcus at g10code.de>
+
+ * gpgmetools.c (gpa_passphrase_cb) [G_OS_WIN32]: Use WriteFile
+ instead of write.
+
2005-11-29 Werner Koch <wk at g10code.com>
* gpa.c (longopts): Made --keymanager an alias for --keyring.
Modified: trunk/src/gpgmetools.c
===================================================================
--- trunk/src/gpgmetools.c 2005-11-29 09:07:32 UTC (rev 726)
+++ trunk/src/gpgmetools.c 2005-12-31 03:48:30 UTC (rev 727)
@@ -670,13 +670,30 @@
gtk_widget_destroy (dialog);
if (response == GTK_RESPONSE_OK)
{
+#ifdef G_OS_WIN32
+ DWORD res;
+ int passphrase_len = strlen (passphrase);
+
+ if (WriteFile ((HANDLE) _get_osfhandle (fd), passphrase,
+ passphrase_len, &res, NULL) == 0
+ || res < passphrase_len)
+ {
+ g_free (passphrase);
+ return gpg_error (gpg_err_code_from_errno (EIO));
+ }
+ else
+ return gpg_error (GPG_ERR_NO_ERROR);
+#else
int res;
res = write (fd, passphrase, strlen (passphrase));
g_free (passphrase);
if (res == -1)
return gpg_error (gpg_err_code_from_errno (errno));
+ else if (res < passphrase_len)
+ return gpg_error (gpg_err_code_from_errno (EIO));
else
return gpg_error (GPG_ERR_NO_ERROR);
+#endif
}
else
{
More information about the Gpa-commits
mailing list