2002-11-25 Marcus Brinkmann <marcus@g10code.de>

* 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.
This commit is contained in:
Marcus Brinkmann 2002-11-25 21:12:46 +00:00
parent bc06e0cb8e
commit 856c4398c6
4 changed files with 11 additions and 9 deletions

View File

@ -1,3 +1,11 @@
2002-11-25 Marcus Brinkmann <marcus@g10code.de>
* 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 <marcus@g10code.de>
* gpgme.h [_MSC_VER]: Define ssize_t as long.

View File

@ -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;
}

View File

@ -1137,21 +1137,18 @@ gpg_start (void *engine, 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;

View File

@ -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"