summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2010-03-08 13:18:19 +0100
committerWerner Koch <wk@gnupg.org>2010-03-08 13:18:19 +0100
commit37088de63df8a2d15a0fb1fc1e0e295225015c7a (patch)
tree4d0bd855a9ff91c7161ea9cfa4e5dc547b28422c /common
parentFirst steps towards the W32CE port (diff)
downloadgnupg2-37088de63df8a2d15a0fb1fc1e0e295225015c7a.tar.xz
gnupg2-37088de63df8a2d15a0fb1fc1e0e295225015c7a.zip
Changes required to use estream in gpgsm.
Diffstat (limited to 'common')
-rw-r--r--common/ChangeLog6
-rw-r--r--common/exechelp.c11
-rw-r--r--common/exechelp.h5
3 files changed, 16 insertions, 6 deletions
diff --git a/common/ChangeLog b/common/ChangeLog
index d63b3657e..f956cc0fd 100644
--- a/common/ChangeLog
+++ b/common/ChangeLog
@@ -1,3 +1,9 @@
+2010-03-08 Werner Koch <wk@g10code.com>
+
+ * exechelp.h: Include "estream.h".
+
+ * exechelp.c (gnupg_spawn_process): Change OUTFILE to an estream_t.
+
2010-03-02 Werner Koch <wk@g10code.com>
* estream.c, estream.h, estream-printf.c, estream-printf.h: Update
diff --git a/common/exechelp.c b/common/exechelp.c
index 4a385bcd7..95e5b633c 100644
--- a/common/exechelp.c
+++ b/common/exechelp.c
@@ -1,5 +1,6 @@
/* exechelp.c - fork and exec helpers
- * Copyright (C) 2004, 2007, 2008, 2009 Free Software Foundation, Inc.
+ * Copyright (C) 2004, 2007, 2008, 2009,
+ * 2010 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@@ -174,7 +175,7 @@ close_all_fds (int first, int *except)
close (fd);
}
- errno = 0;
+ gpg_err_set_errno (0);
}
@@ -555,7 +556,7 @@ gnupg_create_outbound_pipe (int filedes[2])
Returns 0 on success or an error code. */
gpg_error_t
gnupg_spawn_process (const char *pgmname, const char *argv[],
- FILE *infile, FILE *outfile,
+ FILE *infile, estream_t outfile,
void (*preexec)(void), unsigned int flags,
FILE **statusfile, pid_t *pid)
{
@@ -582,7 +583,7 @@ gnupg_spawn_process (const char *pgmname, const char *argv[],
fflush (infile);
rewind (infile);
fd = _get_osfhandle (fileno (infile));
- fdout = _get_osfhandle (fileno (outfile));
+ fdout = _get_osfhandle (es_fileno (outfile));
if (fd == -1 || fdout == -1)
log_fatal ("no file descriptor for file passed to gnupg_spawn_process\n");
@@ -690,7 +691,7 @@ gnupg_spawn_process (const char *pgmname, const char *argv[],
fflush (infile);
rewind (infile);
fd = fileno (infile);
- fdout = fileno (outfile);
+ fdout = es_fileno (outfile);
if (fd == -1 || fdout == -1)
log_fatal ("no file descriptor for file passed to gnupg_spawn_process\n");
diff --git a/common/exechelp.h b/common/exechelp.h
index 8f056891c..06cb79c29 100644
--- a/common/exechelp.h
+++ b/common/exechelp.h
@@ -20,6 +20,9 @@
#ifndef GNUPG_COMMON_EXECHELP_H
#define GNUPG_COMMON_EXECHELP_H
+#include "estream.h"
+
+
/* Return the maximum number of currently allowed file descriptors.
Only useful on POSIX systems. */
int get_max_fds (void);
@@ -59,7 +62,7 @@ gpg_error_t gnupg_create_outbound_pipe (int filedes[2]);
details. Calling gnupg_wait_process is required. Returns 0 on
success or an error code. */
gpg_error_t gnupg_spawn_process (const char *pgmname, const char *argv[],
- FILE *infile, FILE *outfile,
+ FILE *infile, estream_t outfile,
void (*preexec)(void), unsigned int flags,
FILE **statusfile, pid_t *pid);