ソースを参照

libdpkg: Rename database lock functions to use modstatdb_ prefix

Remove now redudant database suffix from the function names.
Guillem Jover 16 年 前
コミット
76c8c559df
共有3 個のファイルを変更した8 個の追加11 個の削除を含む
  1. 4 4
      lib/dpkg/dbmodify.c
  2. 2 5
      lib/dpkg/dpkg-db.h
  3. 2 2
      src/update.c

+ 4 - 4
lib/dpkg/dbmodify.c

@@ -140,7 +140,7 @@ static const struct fni {
 };
 
 void
-lockdatabase(const char *admindir)
+modstatdb_lock(const char *admindir)
 {
   static int dblockfd = -1;
   int n;
@@ -168,7 +168,7 @@ lockdatabase(const char *admindir)
 }
 
 void
-unlockdatabase(void)
+modstatdb_unlock(void)
 {
   unlock_file();
 }
@@ -201,7 +201,7 @@ enum modstatdb_rw modstatdb_init(const char *adir, enum modstatdb_rw readwritere
         ohshit(_("operation requires read/write access to dpkg status area"));
       cstatus= msdbrw_readonly;
     } else {
-      lockdatabase(adir);
+      modstatdb_lock(adir);
       cstatus= (readwritereq == msdbrw_needsuperuserlockonly ?
                 msdbrw_needsuperuserlockonly :
                 msdbrw_write);
@@ -264,7 +264,7 @@ void modstatdb_shutdown(void) {
     varbuf_destroy(&uvb);
     /* fall through */
   case msdbrw_needsuperuserlockonly:
-    unlockdatabase();
+    modstatdb_unlock();
   default:
     break;
   }

+ 2 - 5
lib/dpkg/dpkg-db.h

@@ -187,11 +187,6 @@ struct pkginfo { /* pig */
   struct trigpend *trigpend_head;
 };
 
-/*** from lock.c ***/
-
-void lockdatabase(const char *admindir);
-void unlockdatabase(void);
-
 /*** from dbmodify.c ***/
 
 enum modstatdb_rw {
@@ -205,6 +200,8 @@ enum modstatdb_rw {
   msdbrw_noavail= 0100,
 };
 
+void modstatdb_lock(const char *admindir);
+void modstatdb_unlock(void);
 enum modstatdb_rw modstatdb_init(const char *admindir, enum modstatdb_rw reqrwflags);
 void modstatdb_note(struct pkginfo *pkg);
 void modstatdb_note_ifwrite(struct pkginfo *pkg);

+ 2 - 2
src/update.c

@@ -58,7 +58,7 @@ void updateavailable(const char *const *argv) {
       else
         ohshit(_("bulk available update requires write access to dpkg status area"));
     }
-    lockdatabase(admindir);
+    modstatdb_lock(admindir);
   }
   
   switch (cipaction->arg) {
@@ -88,7 +88,7 @@ void updateavailable(const char *const *argv) {
 
   if (!f_noact) {
     writedb(vb.buf,1,0);
-    unlockdatabase();
+    modstatdb_unlock();
   }
 
   if (cipaction->arg != act_avclear)