dns-cert.c: Use constants for better readability.
[gnupg.git] / sm / keydb.c
index d3b911e..86301b3 100644 (file)
@@ -82,7 +82,6 @@ keydb_add_resource (const char *url, int force, int secret, int *auto_created)
   int rc = 0;
   FILE *fp;
   KeydbResourceType rt = KEYDB_RESOURCE_TYPE_NONE;
-  const char *created_fname = NULL;
 
   if (auto_created)
     *auto_created = 0;
@@ -194,7 +193,6 @@ keydb_add_resource (const char *url, int force, int secret, int *auto_created)
 
           if (!opt.quiet)
             log_info (_("keybox `%s' created\n"), filename);
-          created_fname = filename;
           if (auto_created)
             *auto_created = 1;
        }
@@ -216,12 +214,12 @@ keydb_add_resource (const char *url, int force, int secret, int *auto_created)
               all_resources[used_resources].secret = secret;
 
               all_resources[used_resources].lockhandle
-                = create_dotlock (filename);
+                = dotlock_create (filename, 0);
               if (!all_resources[used_resources].lockhandle)
                 log_fatal ( _("can't create lock for `%s'\n"), filename);
 
               /* Do a compress run if needed and the file is not locked. */
-              if (!make_dotlock (all_resources[used_resources].lockhandle, 0))
+              if (!dotlock_take (all_resources[used_resources].lockhandle, 0))
                 {
                   KEYBOX_HANDLE kbxhd = keybox_new (token, secret);
 
@@ -230,7 +228,7 @@ keydb_add_resource (const char *url, int force, int secret, int *auto_created)
                       keybox_compress (kbxhd);
                       keybox_release (kbxhd);
                     }
-                  release_dotlock (all_resources[used_resources].lockhandle);
+                  dotlock_release (all_resources[used_resources].lockhandle);
                 }
 
               used_resources++;
@@ -423,7 +421,7 @@ lock_all (KEYDB_HANDLE hd)
           break;
         case KEYDB_RESOURCE_TYPE_KEYBOX:
           if (hd->active[i].lockhandle)
-            rc = make_dotlock (hd->active[i].lockhandle, -1);
+            rc = dotlock_take (hd->active[i].lockhandle, -1);
           break;
         }
       if (rc)
@@ -441,7 +439,7 @@ lock_all (KEYDB_HANDLE hd)
                 break;
               case KEYDB_RESOURCE_TYPE_KEYBOX:
                 if (hd->active[i].lockhandle)
-                  release_dotlock (hd->active[i].lockhandle);
+                  dotlock_release (hd->active[i].lockhandle);
                 break;
               }
           }
@@ -471,7 +469,7 @@ unlock_all (KEYDB_HANDLE hd)
           break;
         case KEYDB_RESOURCE_TYPE_KEYBOX:
           if (hd->active[i].lockhandle)
-            release_dotlock (hd->active[i].lockhandle);
+            dotlock_release (hd->active[i].lockhandle);
           break;
         }
     }