diff options
author | Christopher Faylor <me@cgf.cx> | 2003-01-24 01:41:30 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2003-01-24 01:41:30 +0000 |
commit | 8e61c0495ee7f1df6909cae2ffb4d32d40240d00 (patch) | |
tree | 749951bc6458ce6840ea582982c9561d945a1709 /winsup/testsuite/winsup.api/mmaptest03.c | |
parent | 23a30ba8d961bf4462cb5a355299cc6d63aeaa95 (diff) | |
download | cygnal-8e61c0495ee7f1df6909cae2ffb4d32d40240d00.tar.gz cygnal-8e61c0495ee7f1df6909cae2ffb4d32d40240d00.tar.bz2 cygnal-8e61c0495ee7f1df6909cae2ffb4d32d40240d00.zip |
* winsup.api/mmaptest03.c (main): Mark variables as volatile to avoid
optimization induced problems.
Diffstat (limited to 'winsup/testsuite/winsup.api/mmaptest03.c')
-rw-r--r-- | winsup/testsuite/winsup.api/mmaptest03.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/winsup/testsuite/winsup.api/mmaptest03.c b/winsup/testsuite/winsup.api/mmaptest03.c index 5c871dbf2..2af191237 100644 --- a/winsup/testsuite/winsup.api/mmaptest03.c +++ b/winsup/testsuite/winsup.api/mmaptest03.c @@ -40,7 +40,7 @@ main(int argc, char **argv) { int fd, status; struct stat statbuf; - char c, *buf1, *buf2; + volatile char c, *buf1, *buf2; pid_t pid; /* Create data file */ @@ -96,7 +96,7 @@ main(int argc, char **argv) if (setjmp (r)) perror_exit (pid ? "SEGV in parent's munmap" : "SEGV in child's munmap"); - if (munmap(buf1, statbuf.st_size)) + if (munmap((void *) buf1, statbuf.st_size)) perror_exit (pid ? "munmap failed in parent" : "munmap failed in child"); if (setjmp (r) == 0) @@ -113,7 +113,7 @@ main(int argc, char **argv) if (setjmp (r)) perror_exit (pid ? "SEGV in parent's munmap" : "SEGV in child's munmap"); - if (munmap(buf2, statbuf.st_size)) + if (munmap((void *) buf2, statbuf.st_size)) perror_exit (pid ? "munmap failed in parent" : "munmap failed in child"); if (pid) |