[Fakeroot-commits] [SCM] fakeroot branch, upstream, updated. debian/1.14.3-200-gb232f8a

Clint Adams schizo at debian.org
Tue Aug 23 13:06:00 UTC 2011


The following commit has been merged in the upstream branch:
commit d4aa9a99ff223e988fd89066ebdf9cd15dd1c1b5
Author: Clint Adams <schizo at debian.org>
Date:   Thu Sep 20 17:55:19 2007 +0000

    Apply patch from Jan Kluka to fix up database saving.  closes: #443307.
    
    git-archimport-id: fakeroot at packages.debian.org--fakeroot/fakeroot--main--0.0--patch-131

diff --git a/debian/changelog b/debian/changelog
index 3330047..d7a588d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+fakeroot (1.8) unstable; urgency=medium
+
+  * Apply patch from Jan Kluka to fix up database saving.
+    closes: #443307.
+
+ -- Clint Adams <schizo at debian.org>  Thu, 20 Sep 2007 13:46:25 -0400
+
 fakeroot (1.7.1) unstable; urgency=low
 
   * Apply patch from Alexey Shabalovskiy to cope with save-files
diff --git a/faked.c b/faked.c
index 1c5d890..c289c8f 100644
--- a/faked.c
+++ b/faked.c
@@ -454,7 +454,7 @@ int save_database(const uint32_t remote)
   FILE *f;
 
   if(!save_file)
-    return 1;
+    return 0;
 
 #ifdef FAKEROOT_DB_PATH
   path[DB_PATH_LEN] = '\0';
@@ -468,7 +468,7 @@ int save_database(const uint32_t remote)
     int r,fd=0;
     struct stat s;
     r=stat(save_file,&s);
-    if (r<0) return 0;
+    if (r<0 && errno != ENOENT) return EOF;
     if (!(s.st_mode&S_IFIFO)) break;
     fd=open(save_file,O_WRONLY|O_NONBLOCK);
     if (fd<0) {
@@ -482,7 +482,7 @@ int save_database(const uint32_t remote)
 
   f=fopen(save_file, "w");
   if(!f)
-    return 0;
+    return EOF;
 
   for (i = data_begin(); i != data_end(); i = data_node_next(i)) {
     if (i->remote != remote)
@@ -878,12 +878,13 @@ void get_msg(const int listen_sd)
 /***********/
 
 void save(int dummy){
-  if(!save_database(0)) {
-    if(debug)
+  int savedb_state;
+  savedb_state = save_database(0);
+  if(!savedb_state) {
+    if(debug && save_file)
       fprintf(stderr, "fakeroot: saved database in %s\n", save_file);
   } else
-    if(debug)
-      fprintf(stderr, "fakeroot: database save FAILED\n");
+    fprintf(stderr, "fakeroot: database save FAILED\n");
 }
 
 #ifdef FAKEROOT_FAKENET

-- 
fakeroot



More information about the Fakeroot-commits mailing list