Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit bb7f173

Browse files
committed
Reply-To: Jordi MacDonald <jordi@spartanmedia.com>
There is an error in the configure script when using --with-pgport= that will cause the compiled version of PostgreSQL to no longer allow connections to the new port and to treat shared memory improperly. What happens is that if the port is changed, the configure script defines DEF_PGPORT as "", which atoi() will return as 0, which makes the IPC_KEY value 0. This then causes semaphores to be allocated, but never released. Postgres eventually returns from semget() with "no space left on device". The source of this error could easily be overlooked in version 6.3 since it is possible to connect via UNIX domain sockets, and having DEF_PGPORT defined as "0" would not be noticed until TCP was used.
1 parent e4135ad commit bb7f173

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/configure

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,7 @@ echo "configure:807: checking setting DEF_PGPORT" >&5
808808
if test "${with_pgport+set}" = set; then
809809
withval="$with_pgport"
810810
cat >> confdefs.h <<EOF
811-
#define DEF_PGPORT "${DEF_PGPORT}"
811+
#define DEF_PGPORT "${withval}"
812812
EOF
813813
echo "$ac_t""$with_pgport" 1>&6
814814
else
@@ -1003,7 +1003,7 @@ fi
10031003

10041004
echo "$ac_t""$ac_cv_prog_gcc" 1>&6
10051005

1006-
if test "$ac_cv_prog_gcc" = "yes"; then
1006+
if test $ac_cv_prog_gcc = yes; then
10071007
GCC=yes
10081008
ac_test_CFLAGS="${CFLAGS+set}"
10091009
ac_save_CFLAGS="$CFLAGS"

src/configure.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ AC_MSG_CHECKING(setting DEF_PGPORT)
230230
AC_ARG_WITH(
231231
pgport,
232232
[ --with-pgport=<portnum> change default startup port ],
233-
AC_DEFINE_UNQUOTED(DEF_PGPORT, "${DEF_PGPORT}") AC_MSG_RESULT($with_pgport),
233+
AC_DEFINE_UNQUOTED(DEF_PGPORT, "${withval}") AC_MSG_RESULT($with_pgport),
234234
AC_DEFINE_UNQUOTED(DEF_PGPORT, "5432") AC_MSG_RESULT(5432)
235235
)
236236

0 commit comments

Comments
 (0)