Browse Source

Fixed noatime detection

Lee Bousfield 9 years ago
parent
commit
868586dd37
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/borg/testsuite/archiver.py

+ 2 - 1
src/borg/testsuite/archiver.py

@@ -393,7 +393,8 @@ class ArchiverTestCase(ArchiverTestCaseBase):
         def has_noatime(some_file):
             atime_before = os.stat(some_file).st_atime_ns
             try:
-                os.close(os.open(some_file, flags_noatime))
+                with open(os.open(some_file, flags_noatime)) as file:
+                    file.read()
             except PermissionError:
                 return False
             else: