[svn] GnuPG - r4967 - in trunk: agent jnlib po

svn author wk cvs at cvs.gnupg.org
Wed Mar 25 15:58:36 CET 2009


Author: wk
Date: 2009-03-25 15:58:31 +0100 (Wed, 25 Mar 2009)
New Revision: 4967

Modified:
   trunk/agent/ChangeLog
   trunk/agent/gpg-agent.c
   trunk/jnlib/ChangeLog
   trunk/jnlib/logging.c
   trunk/jnlib/t-support.c
   trunk/po/be.po
   trunk/po/ca.po
   trunk/po/cs.po
   trunk/po/da.po
   trunk/po/de.po
   trunk/po/el.po
   trunk/po/eo.po
   trunk/po/es.po
   trunk/po/et.po
   trunk/po/fi.po
   trunk/po/fr.po
   trunk/po/gl.po
   trunk/po/hu.po
   trunk/po/id.po
   trunk/po/it.po
   trunk/po/ja.po
   trunk/po/nb.po
   trunk/po/pl.po
   trunk/po/pt.po
   trunk/po/pt_BR.po
   trunk/po/ro.po
   trunk/po/ru.po
   trunk/po/sk.po
   trunk/po/sv.po
   trunk/po/tr.po
   trunk/po/zh_CN.po
   trunk/po/zh_TW.po
Log:
log file fixes.


Modified: trunk/agent/ChangeLog
===================================================================
--- trunk/agent/ChangeLog	2009-03-24 18:52:24 UTC (rev 4966)
+++ trunk/agent/ChangeLog	2009-03-25 14:58:31 UTC (rev 4967)
@@ -1,3 +1,7 @@
+2009-03-25  Werner Koch  <wk at g10code.com>
+
+	* gpg-agent.c (main): Print a started message to show the real pid.
+
 2009-03-20  Werner Koch  <wk at g10code.com>
 
 	* learncard.c (struct kpinfo_cp_parm_s): Add field CTRL.

Modified: trunk/jnlib/ChangeLog
===================================================================
--- trunk/jnlib/ChangeLog	2009-03-24 18:52:24 UTC (rev 4966)
+++ trunk/jnlib/ChangeLog	2009-03-25 14:58:31 UTC (rev 4967)
@@ -1,3 +1,8 @@
+2009-03-25  Werner Koch  <wk at g10code.com>
+
+	* logging.c (fun_closer): Never close fd 2.
+	(set_file_fd): Close logstream early.
+
 2009-02-25  Werner Koch  <wk at g10code.com>
 
 	* logging.c (get_tid_callback): New.

Modified: trunk/agent/gpg-agent.c
===================================================================
--- trunk/agent/gpg-agent.c	2009-03-24 18:52:24 UTC (rev 4966)
+++ trunk/agent/gpg-agent.c	2009-03-25 14:58:31 UTC (rev 4967)
@@ -467,6 +467,7 @@
           || strcmp (current_logfile, pargs->r.ret_str))
         {
           log_set_file (pargs->r.ret_str);
+          assuan_set_assuan_log_stream (log_get_stream ());
           xfree (current_logfile);
           current_logfile = xtrystrdup (pargs->r.ret_str);
         }
@@ -980,9 +981,10 @@
       else if (pid) 
         { /* We are the parent */
           char *infostr, *infostr_ssh_sock, *infostr_ssh_pid;
-          
+
+          /* Close the socket FD. */
           close (fd);
-          
+
           /* Note that we used a standard fork so that Pth runs in
              both the parent and the child.  The pth_fork would
              terminate Pth in the child but that is not the way we
@@ -1184,6 +1186,7 @@
       }
 #endif /*!HAVE_W32_SYSTEM*/
 
+      log_info ("%s %s started\n", strusage(11), strusage(13) );
       handle_connections (fd, opt.ssh_support ? fd_ssh : GNUPG_INVALID_FD);
       assuan_sock_close (fd);
     }

Modified: trunk/jnlib/logging.c
===================================================================
--- trunk/jnlib/logging.c	2009-03-24 18:52:24 UTC (rev 4966)
+++ trunk/jnlib/logging.c	2009-03-25 14:58:31 UTC (rev 4967)
@@ -218,7 +218,7 @@
 {
   struct fun_cookie_s *cookie = cookie_arg;
 
-  if (cookie->fd != -1)
+  if (cookie->fd != -1 && cookie->fd != 2)
     close (cookie->fd);
   jnlib_free (cookie);
   log_socket = -1;
@@ -239,6 +239,15 @@
   struct fun_cookie_s *cookie;
 #endif
 
+  /* Close an open log stream.  */
+  if (logstream)
+    {
+      if (logstream != stderr && logstream != stdout)
+        fclose (logstream);
+      logstream = NULL;
+    }
+
+  /* Figure out what kind of logging we want.  */
   if (name && !strcmp (name, "-"))
     {
       name = NULL;
@@ -256,6 +265,7 @@
       want_socket = 0;
     }
 
+  /* Setup a new stream.  */
 #ifdef USE_FUNWRITER
   cookie = jnlib_xmalloc (sizeof *cookie + (name? strlen (name):0));
   strcpy (cookie->name, name? name:"");
@@ -310,15 +320,7 @@
 
 #endif /*!USE_FUNWRITER*/
 
-  /* On success close the old logstream right now, so that we are
-     really sure it has been closed. */
-  if (fp && logstream)
-    {
-      if (logstream != stderr && logstream != stdout)
-        fclose (logstream);
-      logstream = NULL;
-    }
-      
+  /* On error default to stderr.  */
   if (!fp)
     {
       if (name)
@@ -333,8 +335,6 @@
   else
     setvbuf (fp, NULL, _IOLBF, 0);
   
-  if (logstream && logstream != stderr && logstream != stdout)
-    fclose (logstream);
   logstream = fp;
 
   /* We always need to print the prefix and the pid for socket mode,

Modified: trunk/jnlib/t-support.c
===================================================================
--- trunk/jnlib/t-support.c	2009-03-24 18:52:24 UTC (rev 4966)
+++ trunk/jnlib/t-support.c	2009-03-25 14:58:31 UTC (rev 4967)
@@ -120,6 +120,7 @@
 int
 gpg_err_code_from_errno (int err)
 {
+  (void)err;
   assert (!"stub function");
   return -1;
 }

Modified: trunk/po/be.po  [not shown]
Modified: trunk/po/ca.po  [not shown]
Modified: trunk/po/cs.po  [not shown]
Modified: trunk/po/da.po  [not shown]
Modified: trunk/po/de.po  [not shown]
Modified: trunk/po/el.po  [not shown]
Modified: trunk/po/eo.po  [not shown]
Modified: trunk/po/es.po  [not shown]
Modified: trunk/po/et.po  [not shown]
Modified: trunk/po/fi.po  [not shown]
Modified: trunk/po/fr.po  [not shown]
Modified: trunk/po/gl.po  [not shown]
Modified: trunk/po/hu.po  [not shown]
Modified: trunk/po/id.po  [not shown]
Modified: trunk/po/it.po  [not shown]
Modified: trunk/po/ja.po  [not shown]
Modified: trunk/po/nb.po  [not shown]
Modified: trunk/po/pl.po  [not shown]
Modified: trunk/po/pt.po  [not shown]
Modified: trunk/po/pt_BR.po  [not shown]
Modified: trunk/po/ro.po  [not shown]
Modified: trunk/po/ru.po  [not shown]
Modified: trunk/po/sk.po  [not shown]
Modified: trunk/po/sv.po  [not shown]
Modified: trunk/po/tr.po  [not shown]
Modified: trunk/po/zh_CN.po  [not shown]
Modified: trunk/po/zh_TW.po  [not shown]




More information about the Gnupg-commits mailing list