OSDN Git Service
(root)
/
uclinux-h8
/
uClibc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
94bf930
)
tests: mmap2: ignore permission denied errors on /dev/mem
author
Mike Frysinger
<vapier@gentoo.org>
Mon, 16 Jan 2012 08:50:04 +0000
(
03:50
-0500)
committer
Mike Frysinger
<vapier@gentoo.org>
Mon, 16 Jan 2012 20:55:10 +0000
(15:55 -0500)
Non-root users can't open /dev/mem, so it makes it hard to pass.
Ignore that case.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
test/mmap/mmap2.c
patch
|
blob
|
history
diff --git
a/test/mmap/mmap2.c
b/test/mmap/mmap2.c
index
b9a8f9a
..
8b94c61
100644
(file)
--- 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);