[svn] GnuPG - r5277 - trunk/common

svn author wk cvs at cvs.gnupg.org
Mon Mar 8 13:18:20 CET 2010


Author: wk
Date: 2010-03-08 13:18:19 +0100 (Mon, 08 Mar 2010)
New Revision: 5277

Modified:
   trunk/common/ChangeLog
   trunk/common/exechelp.c
   trunk/common/exechelp.h
Log:
Changes required to use estream in gpgsm.


Modified: trunk/common/ChangeLog
===================================================================
--- trunk/common/ChangeLog	2010-03-05 11:52:13 UTC (rev 5276)
+++ trunk/common/ChangeLog	2010-03-08 12:18:19 UTC (rev 5277)
@@ -1,3 +1,9 @@
+2010-03-08  Werner Koch  <wk at g10code.com>
+
+	* exechelp.h: Include "estream.h".
+
+	* exechelp.c (gnupg_spawn_process): Change OUTFILE to an estream_t.
+
 2010-03-02  Werner Koch  <wk at g10code.com>
 
 	* estream.c, estream.h, estream-printf.c, estream-printf.h: Update

Modified: trunk/common/exechelp.c
===================================================================
--- trunk/common/exechelp.c	2010-03-05 11:52:13 UTC (rev 5276)
+++ trunk/common/exechelp.c	2010-03-08 12:18:19 UTC (rev 5277)
@@ -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 (fd);
     }
 
-  errno = 0;
+  gpg_err_set_errno (0);
 }
 
 
@@ -555,7 +556,7 @@
    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 @@
   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 @@
   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");
 

Modified: trunk/common/exechelp.h
===================================================================
--- trunk/common/exechelp.h	2010-03-05 11:52:13 UTC (rev 5276)
+++ trunk/common/exechelp.h	2010-03-08 12:18:19 UTC (rev 5277)
@@ -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 @@
    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);
 




More information about the Gnupg-commits mailing list