Hi,

On 29/01/14 21:36, Heikki Linnakangas wrote:
> […]
> Fix pushed.

You are right. Thanks. But there is another bug, see

<20140128154307.gc24...@defunct.ch>

ff. Attached you will find a patch fixing that.

Best regards,

-- 
 Christian Kruse               http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

diff --git a/src/backend/port/sysv_shmem.c b/src/backend/port/sysv_shmem.c
index ac3a9fe..cf590a0 100644
--- a/src/backend/port/sysv_shmem.c
+++ b/src/backend/port/sysv_shmem.c
@@ -380,9 +380,12 @@ CreateAnonymousSegment(Size *size)
 	}
 
 	if (ptr == MAP_FAILED)
+	{
+		int			saved_errno = errno;
+
 		ereport(FATAL,
 				(errmsg("could not map anonymous shared memory: %m"),
-				 (errno == ENOMEM) ?
+				 (saved_errno == ENOMEM) ?
 				 errhint("This error usually means that PostgreSQL's request "
 					"for a shared memory segment exceeded available memory, "
 					  "swap space or huge pages. To reduce the request size "
@@ -390,6 +393,7 @@ CreateAnonymousSegment(Size *size)
 					   "memory usage, perhaps by reducing shared_buffers or "
 						 "max_connections.",
 						 *size) : 0));
+	}
 
 	*size = allocsize;
 	return ptr;

Attachment: pgphzz7yu9Gp0.pgp
Description: PGP signature

Reply via email to