* winsup.api/mmaptest03.c (main): Mark variables as volatile to avoid
optimization induced problems.
This commit is contained in:
		| @@ -1,3 +1,8 @@ | |||||||
|  | 2003-01-23  Christopher Faylor  <cgf@redhat.com> | ||||||
|  |  | ||||||
|  | 	* winsup.api/mmaptest03.c (main): Mark variables as volatile to avoid | ||||||
|  | 	optimization induced problems. | ||||||
|  |  | ||||||
| 2003-01-23  Christopher Faylor  <cgf@redhat.com> | 2003-01-23  Christopher Faylor  <cgf@redhat.com> | ||||||
|  |  | ||||||
| 	* Makefile (check): Add cygrun.exe dependency. | 	* Makefile (check): Add cygrun.exe dependency. | ||||||
|   | |||||||
| @@ -40,7 +40,7 @@ main(int argc, char **argv) | |||||||
| { | { | ||||||
|   int fd, status; |   int fd, status; | ||||||
|   struct stat statbuf; |   struct stat statbuf; | ||||||
|   char c, *buf1, *buf2; |   volatile char c, *buf1, *buf2; | ||||||
|   pid_t pid; |   pid_t pid; | ||||||
|  |  | ||||||
|   /* Create data file */ |   /* Create data file */ | ||||||
| @@ -96,7 +96,7 @@ main(int argc, char **argv) | |||||||
|   if (setjmp (r)) |   if (setjmp (r)) | ||||||
|     perror_exit (pid ? "SEGV in parent's munmap" : "SEGV in child's munmap"); |     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"); |     perror_exit (pid ? "munmap failed in parent" : "munmap failed in child"); | ||||||
|  |  | ||||||
|   if (setjmp (r) == 0) |   if (setjmp (r) == 0) | ||||||
| @@ -113,7 +113,7 @@ main(int argc, char **argv) | |||||||
|   if (setjmp (r)) |   if (setjmp (r)) | ||||||
|     perror_exit (pid ? "SEGV in parent's munmap" : "SEGV in child's munmap"); |     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"); |     perror_exit (pid ? "munmap failed in parent" : "munmap failed in child"); | ||||||
|  |  | ||||||
|   if (pid) |   if (pid) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user