2001-12-13 Marcus Brinkmann <marcus@gnu.org>

* assuan-connect.c (assuan_pipe_connect): Remove code that closes
	all the little file descriptors we set up.
This commit is contained in:
Marcus Brinkmann 2001-12-13 21:38:11 +00:00
parent 05394e788e
commit 0dba5161e2
2 changed files with 8 additions and 19 deletions

View File

@ -1,3 +1,8 @@
2001-12-13 Marcus Brinkmann <marcus@gnu.org>
* assuan-connect.c (assuan_pipe_connect): Remove code that closes
all the little file descriptors we set up.
2001-12-13 Marcus Brinkmann <marcus@gnu.org> 2001-12-13 Marcus Brinkmann <marcus@gnu.org>
* assuan-buffer.c (assuan_read_line): Fix order of execution to * assuan-buffer.c (assuan_read_line): Fix order of execution to

View File

@ -137,26 +137,10 @@ assuan_pipe_connect (ASSUAN_CONTEXT *ctx, const char *name, char *const argv[])
if ((*ctx)->pid == 0) if ((*ctx)->pid == 0)
{ {
int i, n;
char errbuf[512]; char errbuf[512];
#ifdef HAVE_JNLIB_LOGGING
int log_fd = log_get_fd (); close (rp[0]);
#endif close (wp[1]);
/* close all files which will not be duped but keep stderr
and log_stream for now */
n = sysconf (_SC_OPEN_MAX);
if (n < 0)
n = MAX_OPEN_FDS;
for (i=0; i < n; i++)
{
if (i != fileno (stderr)
#ifdef HAVE_JNLIB_LOGGING
&& i != log_fd
#endif
&& i != rp[1] && i != wp[0])
close(i);
}
errno = 0;
/* Dup handles and to stdin/stdout and exec */ /* Dup handles and to stdin/stdout and exec */
if (rp[1] != STDOUT_FILENO) if (rp[1] != STDOUT_FILENO)