about summary refs log tree commit diff
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2012-11-01 00:23:09 +0100
committerThomas Schwinge <thomas@codesourcery.com>2012-11-01 00:23:09 +0100
commitcbc818d0ee66065f3942beffdca82986615aa19a (patch)
tree6418b4226377f40dbec9e682ad89dab6cca2711e
parent5a03cb1e8542fc96dcc072163f5c76f242717159 (diff)
downloadglibc-cbc818d0ee66065f3942beffdca82986615aa19a.tar.gz
glibc-cbc818d0ee66065f3942beffdca82986615aa19a.tar.xz
glibc-cbc818d0ee66065f3942beffdca82986615aa19a.zip
Correct checking for mmap failure.
-rw-r--r--ChangeLog4
-rw-r--r--rt/tst-shm.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 6992adce80..1296ee6d87 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2012-10-31  Thomas Schwinge  <thomas@codesourcery.com>
+
+	* rt/tst-shm.c (worker): Correct checking for mmap failure.
+
 2012-10-31  Andreas Schwab  <schwab@linux-m68k.org>
 
 	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libc.abilist:
diff --git a/rt/tst-shm.c b/rt/tst-shm.c
index 92593bd273..457b075a38 100644
--- a/rt/tst-shm.c
+++ b/rt/tst-shm.c
@@ -73,7 +73,7 @@ worker (int write_now)
     error (EXIT_FAILURE, 0, "size incorrect");
 
   mem = mmap (NULL, 4000, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
-  if (mem == NULL)
+  if (mem == MAP_FAILED)
     error (EXIT_FAILURE, 0, "mmap failed");
 
   ts.tv_sec = 0;