From c2201594f0830c60aaf49fe46e876f8c7f19aa38 Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Mon, 25 Nov 2002 21:04:52 +0000 Subject: [PATCH] 2002-11-25 Marcus Brinkmann * rungpg.c (_gpgme_gpg_spawn): Do not set parent fds to -1. * posix-io.c (_gpgme_io_spawn): Call _gpgme_io_close instead close for parent fds. * w32-io.c (_gpgme_io_spawn): Call _gpgme_io_close instead CloseHandle for parent fds. --- branches/gpgme-0-3-branch/gpgme/ChangeLog | 8 ++++++++ branches/gpgme-0-3-branch/gpgme/posix-io.c | 2 +- branches/gpgme-0-3-branch/gpgme/rungpg.c | 3 --- branches/gpgme-0-3-branch/gpgme/w32-io.c | 7 ++----- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/branches/gpgme-0-3-branch/gpgme/ChangeLog b/branches/gpgme-0-3-branch/gpgme/ChangeLog index 06e9a32..90d1a50 100644 --- a/branches/gpgme-0-3-branch/gpgme/ChangeLog +++ b/branches/gpgme-0-3-branch/gpgme/ChangeLog @@ -1,3 +1,11 @@ +2002-11-25 Marcus Brinkmann + + * rungpg.c (_gpgme_gpg_spawn): Do not set parent fds to -1. + * posix-io.c (_gpgme_io_spawn): Call _gpgme_io_close instead close + for parent fds. + * w32-io.c (_gpgme_io_spawn): Call _gpgme_io_close instead + CloseHandle for parent fds. + 2002-11-22 Marcus Brinkmann * gpgme.h [_MSC_VER]: Define ssize_t as long. diff --git a/branches/gpgme-0-3-branch/gpgme/posix-io.c b/branches/gpgme-0-3-branch/gpgme/posix-io.c index da7c106..ecd7a21 100644 --- a/branches/gpgme-0-3-branch/gpgme/posix-io.c +++ b/branches/gpgme-0-3-branch/gpgme/posix-io.c @@ -257,7 +257,7 @@ _gpgme_io_spawn (const char *path, char **argv, /* .dup_to is not used in the parent list. */ for (i = 0; fd_parent_list[i].fd != -1; i++) - close (fd_parent_list[i].fd); + _gpgme_io_close (fd_parent_list[i].fd); return 0; } diff --git a/branches/gpgme-0-3-branch/gpgme/rungpg.c b/branches/gpgme-0-3-branch/gpgme/rungpg.c index 6cffe35..a3af80d 100644 --- a/branches/gpgme-0-3-branch/gpgme/rungpg.c +++ b/branches/gpgme-0-3-branch/gpgme/rungpg.c @@ -890,21 +890,18 @@ _gpgme_gpg_spawn (GpgObject gpg, void *opaque) fd_parent_list[n].fd = gpg->status.fd[1]; fd_parent_list[n].dup_to = -1; n++; - gpg->status.fd[1] = -1; } if (gpg->colon.fd[1] != -1) { fd_parent_list[n].fd = gpg->colon.fd[1]; fd_parent_list[n].dup_to = -1; n++; - gpg->colon.fd[1] = -1; } for (i = 0; gpg->fd_data_map[i].data; i++) { fd_parent_list[n].fd = gpg->fd_data_map[i].peer_fd; fd_parent_list[n].dup_to = -1; n++; - gpg->fd_data_map[i].peer_fd = -1; } fd_parent_list[n].fd = -1; fd_parent_list[n].dup_to = -1; diff --git a/branches/gpgme-0-3-branch/gpgme/w32-io.c b/branches/gpgme-0-3-branch/gpgme/w32-io.c index 6d4957f..9a1a212 100644 --- a/branches/gpgme-0-3-branch/gpgme/w32-io.c +++ b/branches/gpgme-0-3-branch/gpgme/w32-io.c @@ -899,11 +899,8 @@ _gpgme_io_spawn ( const char *path, char **argv, } /* Close the other ends of the pipes */ - for (i=0; fd_parent_list[i].fd != -1; i++ ) { - DEBUG1 ("Closing fd %d\n", fd_parent_list[i].fd ); - if ( !CloseHandle ( fd_to_handle (fd_parent_list[i].fd) ) ) - DEBUG1 ("CloseHandle failed: ec=%d", (int)GetLastError()); - } + for (i = 0; fd_parent_list[i].fd != -1; i++) + _gpgme_io_close (fd_parent_list[i].fd); DEBUG4 ("CreateProcess ready\n" "- hProcess=%p hThread=%p\n" -- 2.26.2