The following commit has been merged in the master branch:
commit 2cede33e0736d48fd3a6bc85f59904a2825d7475
Author: Guillem Jover <[email protected]>
Date:   Thu Feb 25 23:52:24 2010 +0100

    libdpkg: Rename lock functions to have file_ as prefix
    
    Rename lock_file to file_lock, and unlock_file to file_unlock.

diff --git a/lib/dpkg/dbmodify.c b/lib/dpkg/dbmodify.c
index b416877..8b835dd 100644
--- a/lib/dpkg/dbmodify.c
+++ b/lib/dpkg/dbmodify.c
@@ -160,7 +160,7 @@ modstatdb_lock(const char *admindir)
     }
   }
 
-  lock_file(&dblockfd, dblockfile,
+  file_lock(&dblockfd, dblockfile,
             _("unable to lock dpkg status database"),
             _("status database area is locked by another process"));
 
@@ -170,7 +170,7 @@ modstatdb_lock(const char *admindir)
 void
 modstatdb_unlock(void)
 {
-  unlock_file();
+  file_unlock();
 }
 
 enum modstatdb_rw modstatdb_init(const char *adir, enum modstatdb_rw 
readwritereq) {
diff --git a/lib/dpkg/dpkg.h b/lib/dpkg/dpkg.h
index bd681c2..3d4fe7f 100644
--- a/lib/dpkg/dpkg.h
+++ b/lib/dpkg/dpkg.h
@@ -175,9 +175,9 @@ void cu_closefd(int argc, void **argv);
 
 /*** lock.c ***/
 
-void lock_file(int *lockfd, const char *filename,
+void file_lock(int *lockfd, const char *filename,
                const char *emsg, const char *emsg_eagain);
-void unlock_file(void);
+void file_unlock(void);
 
 /*** from mlib.c ***/
 
diff --git a/lib/dpkg/lock.c b/lib/dpkg/lock.c
index 84ff69d..0ed1d7b 100644
--- a/lib/dpkg/lock.c
+++ b/lib/dpkg/lock.c
@@ -35,7 +35,7 @@
 #include <dpkg/dpkg-db.h>
 
 static void
-cu_unlock_file(int argc, void **argv)
+file_unlock_cleanup(int argc, void **argv)
 {
   int lockfd = *(int*)argv[0];
   struct flock fl;
@@ -50,15 +50,15 @@ cu_unlock_file(int argc, void **argv)
 }
 
 void
-unlock_file(void)
+file_unlock(void)
 {
-  pop_cleanup(ehflag_normaltidy); /* Calls cu_unlock_file. */
+  pop_cleanup(ehflag_normaltidy); /* Calls file_unlock_cleanup. */
 }
 
 /* lockfd must be allocated statically as its addresses is passed to
  * a cleanup handler. */
 void
-lock_file(int *lockfd, const char *filename,
+file_lock(int *lockfd, const char *filename,
           const char *emsg, const char *emsg_eagain)
 {
   struct flock fl;
@@ -76,6 +76,6 @@ lock_file(int *lockfd, const char *filename,
     ohshite(emsg);
   }
 
-  push_cleanup(cu_unlock_file, ~0, NULL, 0, 1, lockfd);
+  push_cleanup(file_unlock_cleanup, ~0, NULL, 0, 1, lockfd);
 }
 
diff --git a/lib/dpkg/trigdeferred.l b/lib/dpkg/trigdeferred.l
index 5832c17..93cb8d6 100644
--- a/lib/dpkg/trigdeferred.l
+++ b/lib/dpkg/trigdeferred.l
@@ -119,7 +119,7 @@ trigdef_update_start(enum trigdef_updateflags uf, const 
char *admindir)
                        }
                }
 
-               lock_file(&lock_fd, fn.buf, _("unable to lock triggers area"),
+               file_lock(&lock_fd, fn.buf, _("unable to lock triggers area"),
                          NULL);
        } else {
                /* Dummy for pop_cleanups. */

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to