[Fakeroot-commits] [SCM] fakeroot branch, upstream, updated. 08ed00124d8b6b445d3b91a9aa15eec638b02f05

Clint Adams schizo at debian.org
Sun Nov 15 03:17:17 UTC 2009


The following commit has been merged in the upstream branch:
commit 4f54eeb027576fa37dcf6065c13e725b83a94313
Author: Clint Adams <schizo at debian.org>
Date:   Thu May 10 14:57:10 2007 +0000

    * Apply patch from Alexey Shabalovskiy to cope with save-files that are named pipes.
    
    git-archimport-id: fakeroot at packages.debian.org--fakeroot/fakeroot--main--0.0--patch-130

diff --git a/faked.c b/faked.c
index baad025..1c5d890 100644
--- a/faked.c
+++ b/faked.c
@@ -464,6 +464,22 @@ int save_database(const uint32_t remote)
     roots = "/";
 #endif
 
+  do {
+    int r,fd=0;
+    struct stat s;
+    r=stat(save_file,&s);
+    if (r<0) return 0;
+    if (!(s.st_mode&S_IFIFO)) break;
+    fd=open(save_file,O_WRONLY|O_NONBLOCK);
+    if (fd<0) {
+      sleep(1);
+      continue;
+    }
+    close(fd);
+    break;
+  } while (1);
+
+
   f=fopen(save_file, "w");
   if(!f)
     return 0;
diff --git a/scripts/fakeroot.in b/scripts/fakeroot.in
index 22d8601..687ae37 100755
--- a/scripts/fakeroot.in
+++ b/scripts/fakeroot.in
@@ -71,7 +71,7 @@ while test "X$1" != "X--"; do
     -s)
        shift
        FAKEDOPTS=$FAKEDOPTS" --save-file $1"
-       WAITINTRAP=1
+       [ -p $1 ] || WAITINTRAP=1
        ;;
     -u|--unknown-is-real)
        FAKEDOPTS=$FAKEDOPTS" --unknown-is-real"

-- 
fakeroot



More information about the Fakeroot-commits mailing list