diff options
Diffstat (limited to 'src/engine-gpgsm.c')
-rw-r--r-- | src/engine-gpgsm.c | 22 |
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 |