summaryrefslogtreecommitdiff
path: root/src/backend/postmaster
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2003-12-01 22:15:38 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2003-12-01 22:15:38 +0000
commit5e2b99db95edea2a23ecdd62b3711a3feb3a28b9 (patch)
treeb2df40aa0867cbf2bc1fec6b70b400ab29bd6a5b /src/backend/postmaster
parent35ddc2edeea919bad940b3e0ca8619688adba4b1 (diff)
Avoid assuming that type key_t is 32 bits, since it reportedly isn't
on 64-bit Solaris. Use a non-system-dependent datatype for UsedShmemSegID, namely unsigned long (which we were already assuming could hold a shmem key anyway, cf RecordSharedMemoryInLockFile).
Diffstat (limited to 'src/backend/postmaster')
-rw-r--r--src/backend/postmaster/postmaster.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index a985708537d..b17ade73761 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -37,7 +37,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.350 2003/11/29 19:51:55 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.351 2003/12/01 22:15:37 tgl Exp $
*
* NOTES
*
@@ -2558,8 +2558,10 @@ BackendFork(Port *port)
#ifdef EXEC_BACKEND
Assert(UsedShmemSegID != 0 && UsedShmemSegAddr != NULL);
/* database name at the end because it might contain commas */
- snprintf(pbuf, NAMEDATALEN + 256, "%d,%d,%d,%p,%s", port->sock, canAcceptConnections(),
- UsedShmemSegID, UsedShmemSegAddr, port->database_name);
+ snprintf(pbuf, sizeof(pbuf), "%d,%d,%lu,%p,%s",
+ port->sock, canAcceptConnections(),
+ UsedShmemSegID, UsedShmemSegAddr,
+ port->database_name);
av[ac++] = pbuf;
#else
av[ac++] = port->database_name;
@@ -2902,8 +2904,8 @@ SSDataBase(int xlop)
#ifdef EXEC_BACKEND
Assert(UsedShmemSegID != 0 && UsedShmemSegAddr != NULL);
/* database name at the end because it might contain commas */
- snprintf(pbuf, NAMEDATALEN + 256, "%d,%p,%s", UsedShmemSegID,
- UsedShmemSegAddr, "template1");
+ snprintf(pbuf, sizeof(pbuf), "%lu,%p,%s",
+ UsedShmemSegID, UsedShmemSegAddr, "template1");
av[ac++] = pbuf;
#else
av[ac++] = "template1";