From: Marcus Brinkmann Date: Thu, 13 Dec 2001 22:36:03 +0000 (+0000) Subject: 2001-12-13 Marcus Brinkmann X-Git-Tag: gpgme-1.2.0@1385~1206 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cd4afea4e5cd59ef62bad43070cb805658519090;p=gpgme.git 2001-12-13 Marcus Brinkmann * 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. --- diff --git a/trunk/gpgme/ChangeLog b/trunk/gpgme/ChangeLog index 0aca485..569005f 100644 --- a/trunk/gpgme/ChangeLog +++ b/trunk/gpgme/ChangeLog @@ -1,3 +1,11 @@ +2001-12-13 Marcus Brinkmann + + * 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 * engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): Do not add `armor' diff --git a/trunk/gpgme/rungpg.c b/trunk/gpgme/rungpg.c index d1c50cc..6151f7d 100644 --- a/trunk/gpgme/rungpg.c +++ b/trunk/gpgme/rungpg.c @@ -818,9 +818,9 @@ _gpgme_gpg_spawn( GpgObject gpg, void *opaque ) 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); @@ -828,21 +828,12 @@ _gpgme_gpg_spawn( GpgObject gpg, void *opaque ) /* 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; diff --git a/trunk/gpgme/version.c b/trunk/gpgme/version.c index 762b6ea..b2146db 100644 --- a/trunk/gpgme/version.c +++ b/trunk/gpgme/version.c @@ -203,8 +203,7 @@ _gpgme_get_program_version (const char *const path) 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) @@ -214,8 +213,7 @@ _gpgme_get_program_version (const char *const 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)