Added 64-bit patches by Ihno Krumreich, email: ihno@caldera.de
diff --git a/testcases/kernel/syscalls/mmap/mmap02.c b/testcases/kernel/syscalls/mmap/mmap02.c
index f6acae0..c5905b8 100644
--- a/testcases/kernel/syscalls/mmap/mmap02.c
+++ b/testcases/kernel/syscalls/mmap/mmap02.c
@@ -121,11 +121,11 @@
 		 * Call mmap to map the temporary file 'TEMPFILE'
 	 	 * with read access.
 		 */
-		TEST(mmap(0, page_sz, PROT_READ,
-			    MAP_FILE|MAP_SHARED, fildes, 0));
+		errno = 0; addr = mmap(0, page_sz, PROT_READ,
+			    MAP_FILE|MAP_SHARED, fildes, 0);
 
 		/* Check for the return value of mmap() */
-		if (TEST_RETURN == (int)MAP_FAILED) {
+		if (addr == MAP_FAILED) {
 			tst_resm(TFAIL, "mmap() Failed on %s, errno=%d : %s",
 				 TEMPFILE, errno, strerror(errno));
 			continue;
@@ -135,9 +135,6 @@
 		 * executed without (-f) option.
 		 */
 		if (STD_FUNCTIONAL_TEST) {
-			/* Get the mmap return value */
-			addr = (char *)TEST_RETURN;
-
 			/*
 			 * Read the file contents into the dummy
 			 * string.