]> arthur.barton.de Git - bup.git/commit
hashsplit: skip uncaching when mmap is unsupported
authorRob Browning <rlb@defaultvalue.org>
Thu, 17 Dec 2015 23:32:36 +0000 (17:32 -0600)
committerRob Browning <rlb@defaultvalue.org>
Thu, 17 Dec 2015 23:32:36 +0000 (17:32 -0600)
commit7391df7c374e492c212e504b44de976d77037523
tree120030ac93242623b39cfa57cc4546f1cf25d1b3
parent7e0fcaa5b28eb1aa022a59e5056679e7854070b9
hashsplit: skip uncaching when mmap is unsupported

Skip our fmincore based uncaching for any file region where mmap throws
an mmap.error with errno set to ENODEV, i.e.:

  mmap.error: [Errno 19] Operation not supported by device

by having fmincore return None.  This happens on some platforms when the
input is a pipe, i.e.:

  ... | bup split ...

Thanks to Thomas Klausner and Greg Troxel for reporting the problem.

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