]> arthur.barton.de Git - bup.git/commitdiff
Ignore mincore when it returns ENOSYS
authorRob Browning <rlb@defaultvalue.org>
Sat, 13 Jan 2018 16:23:49 +0000 (10:23 -0600)
committerRob Browning <rlb@defaultvalue.org>
Mon, 15 Jan 2018 20:04:54 +0000 (14:04 -0600)
Observed on WSL.  Thanks to Levent Dane <leventdane@gmail.com> for
reporting the problem and helping test the fix.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
README.md
lib/bup/helpers.py

index e5d0f7315392d02b8e8545885fa39be3e8e24af2..267bf7e35ebc6945d514bfdf6b88a5e62b53bde9 100644 (file)
--- a/README.md
+++ b/README.md
@@ -77,8 +77,8 @@ Reasons you might want to avoid bup
    of corruption.
  
  - It currently only works on Linux, FreeBSD, NetBSD, OS X >= 10.4,
-   Solaris, or Windows (with Cygwin).  Patches to support other
-   platforms are welcome.
+   Solaris, or Windows (with Cygwin, and maybe with WSL).  Patches to
+   support other platforms are welcome.
 
  - Any items in "Things that are stupid" below.
 
index d05226ebc28207dd94435a6c920ef99c4933b721..e7df2321415b8321bb7c6bb9b712d2d0bc69ad3e 100644 (file)
@@ -847,7 +847,12 @@ if _mincore:
                     # Perhaps the file was a pipe, i.e. "... | bup split ..."
                     return None
                 raise ex
-            _mincore(m, msize, 0, result, ci * pages_per_chunk);
+            try:
+                _mincore(m, msize, 0, result, ci * pages_per_chunk)
+            except OSError as ex:
+                if ex.errno == errno.ENOSYS:
+                    return None
+                raise
         return result