aboutsummaryrefslogtreecommitdiffstats
path: root/src/engine-gpgsm.c
diff options
context:
space:
mode:
authorMarcus Brinkmann <[email protected]>2010-05-07 01:06:14 +0000
committerMarcus Brinkmann <[email protected]>2010-05-07 01:06:14 +0000
commit97df297ae2b9df6a5717df6949187e27d2eb73de (patch)
treecc94452d36e18ba57f6958f489b54429ed58ebf7 /src/engine-gpgsm.c
parent2010-05-06 Marcus Brinkmann <[email protected]> (diff)
downloadgpgme-97df297ae2b9df6a5717df6949187e27d2eb73de.tar.gz
gpgme-97df297ae2b9df6a5717df6949187e27d2eb73de.zip
2010-05-07 Marcus Brinkmann <[email protected]>
* engine-gpgsm.c (gpgsm_new, start): Cast between int and assuan_fd_t. * assuan-support.c (my_pipe, my_close, my_read, my_write): Likewise. * gpgme-tool.c (server_data_obj, server_reset_fds, gpgme_server), (my_recvmsg, my_sendmsg, my_spawn): Likewise. * engine-assuan.c (start): Likewise. * engine-g13.c (start): Likewise.
Diffstat (limited to 'src/engine-gpgsm.c')
-rw-r--r--src/engine-gpgsm.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/engine-gpgsm.c b/src/engine-gpgsm.c
index dd1ea3ef..fce46599 100644
--- a/src/engine-gpgsm.c
+++ b/src/engine-gpgsm.c
@@ -338,9 +338,18 @@ gpgsm_new (void **engine, const char *file_name, const char *home_dir)
(gpgsm->assuan_ctx, file_name ? file_name : _gpgme_get_gpgsm_path (),
argv, NULL, NULL, NULL, ASSUAN_PIPE_CONNECT_FDPASSING);
#else
- err = assuan_pipe_connect
- (gpgsm->assuan_ctx, file_name ? file_name : _gpgme_get_gpgsm_path (),
- argv, child_fds, NULL, NULL, 0);
+ {
+ assuan_fd_t achild_fds[4];
+ int i;
+
+ /* For now... */
+ for (i = 0; i < 4; i++)
+ achild_fds[i] = (assuan_fd_t) child_fds[i];
+
+ err = assuan_pipe_connect
+ (gpgsm->assuan_ctx, file_name ? file_name : _gpgme_get_gpgsm_path (),
+ argv, achild_fds, NULL, NULL, 0);
+ }
/* On Windows, handles are inserted in the spawned process with
DuplicateHandle, and child_fds contains the server-local names
@@ -997,16 +1006,21 @@ static gpgme_error_t
start (engine_gpgsm_t gpgsm, const char *command)
{
gpgme_error_t err;
+ assuan_fd_t afdlist[5];
int fdlist[5];
int nfds;
+ int i;
/* We need to know the fd used by assuan for reads. We do this by
using the assumption that the first returned fd from
assuan_get_active_fds() is always this one. */
nfds = assuan_get_active_fds (gpgsm->assuan_ctx, 0 /* read fds */,
- fdlist, DIM (fdlist));
+ afdlist, DIM (afdlist));
if (nfds < 1)
return gpg_error (GPG_ERR_GENERAL); /* FIXME */
+ /* For now... */
+ for (i = 0; i < nfds; i++)
+ fdlist[i] = (int) afdlist[i];
/* We "duplicate" the file descriptor, so we can close it here (we
can't close fdlist[0], as that is closed by libassuan, and