[git] GnuPG - branch, master, updated. gnupg-2.1.16-18-gbfeafe2

by Neal H. Walfield cvs at cvs.gnupg.org
Tue Nov 22 17:12:41 CET 2016


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 "The GNU Privacy Guard".

The branch, master has been updated
       via  bfeafe2d3f9bbaa7f11f3ad870a446141c038b0d (commit)
      from  44c17bcb003a3330f595a6ab144e8439b7b630cb (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 bfeafe2d3f9bbaa7f11f3ad870a446141c038b0d
Author: Neal H. Walfield <neal at g10code.com>
Date:   Tue Nov 22 17:12:38 2016 +0100

    g10: Use es_fopen instead of open.
    
    * g10/tofu.c: Don't include <utime.h>, <fcntl.h> or <unistd.h>.
    (busy_handler): Replace use of open with es_fopen.
    
    --
    Signed-off-by: Neal H. Walfield <neal at g10code.com>
    
    Thanks for Werner for pointing this out: es_fopen is more portable
    than open.

diff --git a/g10/tofu.c b/g10/tofu.c
index d7730a3..8575947 100644
--- a/g10/tofu.c
+++ b/g10/tofu.c
@@ -29,9 +29,6 @@
 #include <stdarg.h>
 #include <sqlite3.h>
 #include <time.h>
-#include <utime.h>
-#include <fcntl.h>
-#include <unistd.h>
 
 #include "gpg.h"
 #include "types.h"
@@ -909,21 +906,23 @@ busy_handler (void *cookie, int call_count)
 
   (void) call_count;
 
-  /* Update the lock file time stamp so that the current owner knows
-     that we want the lock.  */
+  /* Update the want-lock-file time stamp (specifically, the ctime) so
+   * that the current owner knows that we (well, someone) want the
+   * lock.  */
   if (dbs)
     {
       /* Note: we don't fail if we can't create the lock file: this
-         process will have to wait a bit longer, but otherwise nothing
-         horrible should happen.  */
+       * process will have to wait a bit longer, but otherwise nothing
+       * horrible should happen.  */
 
-      int fd = open (dbs->want_lock_file, O_CREAT|O_WRONLY|O_TRUNC,
-                     S_IRUSR|S_IRGRP|S_IROTH|S_IWUSR);
-      if (fd == -1)
+      estream_t fp;
+
+      fp = es_fopen (dbs->want_lock_file, "w");
+      if (! fp)
         log_debug ("TOFU: Error opening '%s': %s\n",
                    dbs->want_lock_file, strerror (errno));
       else
-        close (fd);
+        es_fclose (fp);
     }
 
   /* Call again.  */

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

Summary of changes:
 g10/tofu.c | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list