From 36a68bc5308c0b4a541ca6adea5d3635217e8af2 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 23 May 2023 15:52:25 +0200 Subject: python: Fix wrong use of write. * lang/python/helpers.c (pyPassphraseCb): Use gpgme_io_writen. (_gpg_interact_cb): Ditto. * lang/python/helpers.h (write) [W32]: Remove bad write macro. -- GnuPG-bug-id: T6501 Using write(2) without checking for EINTR is a not a good idea. Futher gpgme_io_writen is the correct way to send data from a callback. This also fixed the wrong use of a simple macro for Windows. --- lang/python/helpers.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'lang/python/helpers.h') diff --git a/lang/python/helpers.h b/lang/python/helpers.h index 61f538e2..e9faa7cf 100644 --- a/lang/python/helpers.h +++ b/lang/python/helpers.h @@ -25,11 +25,6 @@ #include #include "Python.h" -#ifdef _WIN32 -#include -#define write(fd, str, sz) {DWORD written; WriteFile((HANDLE) fd, str, sz, &written, 0);} -#endif - /* Flag specifying whether this is an in-tree build. */ extern int gpg_in_tree_build; -- cgit v1.2.3