Преглед изворни кода

Rename checkpoint function to modstatdb_checkpoint and make it global

Ian Jackson пре 18 година
родитељ
комит
5daeb588b6
3 измењених фајлова са 10 додато и 3 уклоњено
  1. 6 0
      ChangeLog
  2. 3 3
      lib/dbmodify.c
  3. 1 0
      lib/dpkg-db.h

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+2008-03-20  Ian Jackson  <ian@davenant.greenend.org.uk>
+
+	* lib/dpkg-db.h (modstatdb_checkpoint): New prototype.
+	* lib/dbmodify.c (checkpoint):  Remove static keyword. Rename to ...
+	(modstatdb_checkpoint): ... this. Fix all callers.
+
 2008-03-20  Ian Jackson  <ian@davenant.greenend.org.uk>
 
 	* lib/tarfn.c (TarExtractor): Initialize h.LinkName and h.Name to

+ 3 - 3
lib/dbmodify.c

@@ -195,7 +195,7 @@ enum modstatdb_rw modstatdb_init(const char *adir, enum modstatdb_rw readwritere
   return cstatus;
 }
 
-static void checkpoint(void) {
+void modstatdb_checkpoint(void) {
   int i;
 
   assert(cstatus >= msdbrw_write);
@@ -214,7 +214,7 @@ void modstatdb_shutdown(void) {
   const struct fni *fnip;
   switch (cstatus) {
   case msdbrw_write:
-    checkpoint();
+    modstatdb_checkpoint();
     writedb(availablefile,1,0);
     /* tidy up a bit, but don't worry too much about failure */
     fclose(importanttmp);
@@ -279,7 +279,7 @@ void modstatdb_note(struct pkginfo *pkg) {
   nextupdate++;  
 
   if (nextupdate > MAXUPDATES) {
-    checkpoint();
+    modstatdb_checkpoint();
     nextupdate= 0;
   }
 

+ 1 - 0
lib/dpkg-db.h

@@ -170,6 +170,7 @@ extern struct pipef *status_pipes;
 
 enum modstatdb_rw modstatdb_init(const char *admindir, enum modstatdb_rw reqrwflags);
 void modstatdb_note(struct pkginfo *pkg);
+void modstatdb_checkpoint(void);
 void modstatdb_shutdown(void);
 
 extern char *statusfile, *availablefile; /* initialised by modstatdb_init */