[git] GPG-ERROR - branch, master, updated. libgpg-error-1.27-228-g6e8a7a8

by Werner Koch cvs at cvs.gnupg.org
Mon Nov 27 14:52:54 CET 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Error codes used by GnuPG et al.".

The branch, master has been updated
       via  6e8a7a87e00844b0efb449516ddf3aaa0b8dc750 (commit)
       via  84ebd2f34882d29510f819a797fade0297fe9ab9 (commit)
       via  d1e3401013f85620f3136958be079c13ca758b20 (commit)
      from  e0ef8126c20216f79b7ad147c103bb2cf2790c59 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 6e8a7a87e00844b0efb449516ddf3aaa0b8dc750
Author: Werner Koch <wk at gnupg.org>
Date:   Mon Nov 27 14:48:15 2017 +0100

    doc: Add a comment to the Windows registry functions.
    
    --

diff --git a/src/w32-reg.c b/src/w32-reg.c
index 8aefa52..8b1bf8a 100644
--- a/src/w32-reg.c
+++ b/src/w32-reg.c
@@ -39,7 +39,9 @@
 
 /* Return a string from the W32 Registry or NULL in case of error.
  * Caller must release the return value.  A NULL for root is an alias
- * for HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE in turn. */
+ * for HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE in turn.  The returned
+ * string is UTF-8 encoded; ROOT, DIR, and NAME must be plain
+ * ASCII. */
 char *
 _gpgrt_w32_reg_query_string (const char *root, const char *dir,
                              const char *name)
@@ -74,6 +76,8 @@ _gpgrt_w32_reg_query_string (const char *root, const char *dir,
         return NULL; /* still no need for a RegClose, so return direct */
     }
 
+
+  /* FIXME:  Use wide functions and convert to utf-8.  */
   nbytes = 1;
   if (RegQueryValueExA (key_handle, name, 0, NULL, NULL, &nbytes))
     {

commit 84ebd2f34882d29510f819a797fade0297fe9ab9
Author: Werner Koch <wk at gnupg.org>
Date:   Mon Nov 27 14:47:11 2017 +0100

    core: Avoid endless recursion if log_set_sink has not been used.
    
    * src/logging.c (_gpgrt_log_set_sink): Do not call gf_is_valid if the
    default sink has been requested.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/src/logging.c b/src/logging.c
index dbd8066..13873eb 100644
--- a/src/logging.c
+++ b/src/logging.c
@@ -559,7 +559,8 @@ set_file_fd (const char *name, int fd)
  * "socket:///home/foo/mylogs" may be used to write the logging to the
  * socket "/home/foo/mylogs".  If the connection to the socket fails
  * or a write error is detected, the function writes to stderr and
- * tries the next time again to connect the socket.
+ * tries the next time again to connect the socket.  Calling this
+ * function with (NULL, NULL, -1) sets the default sink.
  * Warning: This function is not thread-safe.
  */
 void
@@ -567,7 +568,7 @@ _gpgrt_log_set_sink (const char *name, estream_t stream, int fd)
 {
   if (name && !stream && fd == -1)
     set_file_fd (name, -1);
-  else if (!name && !stream)
+  else if (!name && !stream && fd != -1)
     {
       if (!_gpgrt_fd_valid_p (fd))
         _gpgrt_log_fatal ("gpgrt_log_set_sink: fd is invalid: %s\n",

commit d1e3401013f85620f3136958be079c13ca758b20
Author: Werner Koch <wk at gnupg.org>
Date:   Mon Nov 27 13:40:23 2017 +0100

    core: Add new macro log_assert to the API.
    
    * src/gpg-error.h.in (log_assert): New macro.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/src/gpg-error.h.in b/src/gpg-error.h.in
index f157fd8..35027d6 100644
--- a/src/gpg-error.h.in
+++ b/src/gpg-error.h.in
@@ -955,8 +955,7 @@ void _gpgrt_log_assert (const char *expr, const char *file, int line,
    ? (void) 0                                                   \
    : _gpgrt_log_assert (#expr, __FILE__, __LINE__, __FUNCTION__))
 #else /*!GPGRT_HAVE_MACRO_FUNCTION*/
-void _gpgrt_log_assert (const char *expr, const char *file, int line);
-#define gpgrt_assert(expr)                                      \
+# define gpgrt_assert(expr)                                     \
   ((expr)                                                       \
    ? (void) 0                                                   \
    : _gpgrt_log_assert (#expr, __FILE__, __LINE__, NULL))
@@ -989,6 +988,18 @@ void _gpgrt_log_assert (const char *expr, const char *file, int line);
 # define log_printhex            gpgrt_log_printhex
 # define log_clock               gpgrt_log_clock
 # define log_flush               gpgrt_log_flush
+# ifdef GPGRT_HAVE_MACRO_FUNCTION
+#  define log_assert(expr)                                      \
+  ((expr)                                                       \
+   ? (void) 0                                                   \
+   : _gpgrt_log_assert (#expr, __FILE__, __LINE__, __FUNCTION__))
+# else /*!GPGRT_HAVE_MACRO_FUNCTION*/
+#  define log_assert(expr)                                      \
+  ((expr)                                                       \
+   ? (void) 0                                                   \
+   : _gpgrt_log_assert (#expr, __FILE__, __LINE__, NULL))
+# endif /*!GPGRT_HAVE_MACRO_FUNCTION*/
+
 #endif /*GPGRT_ENABLE_LOG_MACROS*/
 
 

-----------------------------------------------------------------------

Summary of changes:
 src/gpg-error.h.in | 15 +++++++++++++--
 src/logging.c      |  5 +++--
 src/w32-reg.c      |  6 +++++-
 3 files changed, 21 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
Error codes used by GnuPG et al.
http://git.gnupg.org




More information about the Gnupg-commits mailing list