+2001-12-13 Marcus Brinkmann <marcus@g10code.de>
+
+ * rungpg.c (_gpgme_gpg_spawn): Do not add the fds to the child
+ list that are not dup'ed, for those the close-on-exec flag is set
+ now.
+ * version.c (_gpgme_get_program_version): Remove first entry in
+ CFD, as the close-on-exec flag is now set for this fd.
+
2001-12-13 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): Do not add `armor'
if ( rc )
return rc;
- n = 4; /* status fd, 2*colon_fd and end of list */
+ n = 3; /* status_fd, colon_fd and end of list */
for (i=0; gpg->fd_data_map[i].data; i++ )
- n += 2;
+ n++;
fd_child_list = xtrycalloc ( n+n, sizeof *fd_child_list );
if (!fd_child_list)
return mk_error (Out_Of_Core);
/* build the fd list for the child */
n=0;
- fd_child_list[n].fd = gpg->status.fd[0];
- fd_child_list[n].dup_to = -1;
- n++;
if ( gpg->colon.fnc ) {
- fd_child_list[n].fd = gpg->colon.fd[0];
- fd_child_list[n].dup_to = -1;
- n++;
fd_child_list[n].fd = gpg->colon.fd[1];
fd_child_list[n].dup_to = 1; /* dup to stdout */
n++;
}
for (i=0; gpg->fd_data_map[i].data; i++ ) {
- fd_child_list[n].fd = gpg->fd_data_map[i].fd;
- fd_child_list[n].dup_to = -1;
- n++;
if (gpg->fd_data_map[i].dup_to != -1) {
fd_child_list[n].fd = gpg->fd_data_map[i].peer_fd;
fd_child_list[n].dup_to = gpg->fd_data_map[i].dup_to;
int nread;
char *argv[] = {(char *) path, "--version", 0};
struct spawn_fd_item_s pfd[] = { {0, -1}, {-1, -1} };
- struct spawn_fd_item_s cfd[] = { {0, -1}, {-1, 1 /* STDOUT_FILENO */},
- {-1, -1} };
+ struct spawn_fd_item_s cfd[] = { {-1, 1 /* STDOUT_FILENO */}, {-1, -1} };
int status, signal;
if (!path)
return NULL;
pfd[0].fd = rp[1];
- cfd[0].fd = rp[0];
- cfd[1].fd = rp[1];
+ cfd[0].fd = rp[1];
pid = _gpgme_io_spawn (path, argv, cfd, pfd);
if (pid < 0)