[git] GnuPG - branch, master, updated. gnupg-2.1.0beta3-7-g0dce267

by Marcus Brinkmann cvs at cvs.gnupg.org
Tue Jan 3 18:02:49 CET 2012


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  0dce26778ef8abd4fc40de689d7ec9b720d26430 (commit)
      from  61ccd8d92d9d3b8ba0eca3c2969d7f6f37e16405 (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 0dce26778ef8abd4fc40de689d7ec9b720d26430
Author: Marcus Brinkmann <marcus.brinkmann at ruhr-uni-bochum.de>
Date:   Tue Jan 3 17:08:01 2012 +0100

    Fix compiler warnings.
    
    * common/dotlock.c (use_hardlinks_p, dotlock_take_unix): Check return
    value of link().
    * g13/g13.c: Make sure err is initialized.
    * scd/scdaemon.c (main) [!USE_GCRY_THREAD_CBS]: Do not define ERR.

diff --git a/common/dotlock.c b/common/dotlock.c
index b4734b9..58a3d0f 100644
--- a/common/dotlock.c
+++ b/common/dotlock.c
@@ -583,16 +583,21 @@ use_hardlinks_p (const char *tname)
   strcpy (lname, tname);
   strcat (lname, "x");
 
-  link (tname, lname);
-
-  if (stat (tname, &sb))
-    res = -1;  /* Ooops.  */
-  else if (sb.st_nlink == nlink + 1)
-    res = 0;   /* Yeah, hardlinks are supported.  */
+  res = link (tname, lname);
+  if (res < 0)
+    res = -1;
   else
-    res = 1;   /* No hardlink support.  */
+    {
+      if (stat (tname, &sb))
+	res = -1;  /* Ooops.  */
+      else if (sb.st_nlink == nlink + 1)
+	res = 0;   /* Yeah, hardlinks are supported.  */
+      else
+	res = 1;   /* No hardlink support.  */
+
+      unlink (lname);
+    }
 
-  unlink (lname);
   jnlib_free (lname);
   return res;
 }
@@ -948,6 +953,7 @@ dotlock_destroy (dotlock_t h)
 static int
 dotlock_take_unix (dotlock_t h, long timeout)
 {
+  int res;
   int wtime = 0;
   int sumtime = 0;
   int pid;
@@ -1004,7 +1010,13 @@ dotlock_take_unix (dotlock_t h, long timeout)
     {
       struct stat sb;
 
-      link (h->tname, h->lockname);
+      res = link (h->tname, h->lockname);
+      if (res < 0)
+	{
+          my_error_1 ("lock not made: Oops: link of tmp file failed: %s\n",
+                      strerror (errno));
+	  return -1;
+	}
 
       if (stat (h->tname, &sb))
         {
diff --git a/g13/g13.c b/g13/g13.c
index bc05977..0f73094 100644
--- a/g13/g13.c
+++ b/g13/g13.c
@@ -686,6 +686,7 @@ main ( int argc, char **argv)
 #endif /*0*/
 
   /* Dispatch command.  */
+  err = 0;
   switch (cmd)
     {
     case aGPGConfList:
diff --git a/scd/scdaemon.c b/scd/scdaemon.c
index 6f8d010..e26beba 100644
--- a/scd/scdaemon.c
+++ b/scd/scdaemon.c
@@ -382,7 +382,9 @@ main (int argc, char **argv )
 {
   ARGPARSE_ARGS pargs;
   int orig_argc;
+#ifdef USE_GCRY_THREAD_CBS
   gpg_error_t err;
+#endif
   char **orig_argv;
   FILE *configfp = NULL;
   char *configname = NULL;

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

Summary of changes:
 common/dotlock.c |   30 +++++++++++++++++++++---------
 g13/g13.c        |    1 +
 scd/scdaemon.c   |    2 ++
 3 files changed, 24 insertions(+), 9 deletions(-)


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




More information about the Gnupg-commits mailing list