>From 226e87dc20596015501143af028ff7b6aba58f1a Mon Sep 17 00:00:00 2001 From: Christian Kellermann Date: Thu, 11 Apr 2013 14:15:27 +0200 Subject: [PATCH] Avoid segfaulting in mmap test by providing map/shared flag. Also remove bogus assert. It's a test, if it crashes it crashes, the assert will always be true. Flow analysis and J Altfas found this independently. Signed-off-by: Christian Kellermann --- tests/posix-tests.scm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/posix-tests.scm b/tests/posix-tests.scm index 1f934d9..e869f2c 100644 --- a/tests/posix-tests.scm +++ b/tests/posix-tests.scm @@ -37,9 +37,8 @@ (data "abcde") (size 5)) (file-write tmpfilno data) - (let ((mmap (map-file-to-memory #f size prot/read map/file tmpfilno)) + (let ((mmap (map-file-to-memory #f size prot/read (+ map/shared map/file) tmpfilno)) (str (make-string size))) - (assert (memory-mapped-file? mmap)) (move-memory! (memory-mapped-file-pointer mmap) str size) (assert (blob=? (string->blob data) (string->blob str))) (unmap-file-from-memory mmap)))) -- 1.7.10.4