소스 검색

chunker: add a check whether the POSIX_FADV_DONTNEED constant is defined

on openbsd, it isn't.
Thomas Waldmann 9 년 전
부모
커밋
bc5949a7f4
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      borg/_chunker.c

+ 1 - 1
borg/_chunker.c

@@ -156,7 +156,7 @@ chunker_fill(Chunker *c)
             return 0;
         }
         length = c->bytes_read - offset;
-        #if ( _XOPEN_SOURCE >= 600 || _POSIX_C_SOURCE >= 200112L )
+        #if ( ( _XOPEN_SOURCE >= 600 || _POSIX_C_SOURCE >= 200112L ) && defined(POSIX_FADV_DONTNEED) )
         // We tell the OS that we do not need the data that we just have read any
         // more (that it maybe has in the cache). This avoids that we spoil the
         // complete cache with data that we only read once and (due to cache