summaryrefslogtreecommitdiff
path: root/test/mmap
diff options
context:
space:
mode:
Diffstat (limited to 'test/mmap')
-rw-r--r--test/mmap/mmap2.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/mmap/mmap2.c b/test/mmap/mmap2.c
index b9a8f9ac4..8b94c6199 100644
--- a/test/mmap/mmap2.c
+++ b/test/mmap/mmap2.c
@@ -25,7 +25,12 @@ int main(int argc, char **argv) {
void* map_base = 0;
int fd;
off_t target = 0xfffff000;
- if((fd = open("/dev/mem", O_RDWR | O_SYNC)) == -1) FATAL;
+ if((fd = open("/dev/mem", O_RDWR | O_SYNC)) == -1) {
+ /* skip test for non-root users */
+ if (errno == EACCES)
+ return 0;
+ FATAL;
+ }
printf("/dev/mem opened.\n");
fflush(stdout);