aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2003-05-07 03:47:08 +0000
committerBruce Momjian <bruce@momjian.us>2003-05-07 03:47:08 +0000
commit07d35e4277da141475793cc67c373183ecd71453 (patch)
treedeadaf1f4015413e9a2252901708760d537138c8
parent6165a278e52046de6e6c9ccf854566b6a1e22f0f (diff)
downloadpostgresql-07d35e4277da141475793cc67c373183ecd71453.tar.gz
postgresql-07d35e4277da141475793cc67c373183ecd71453.zip
Change alternate database location patch to test for symlink() rather
than WIN32.
-rwxr-xr-xconfigure5
-rw-r--r--configure.in4
-rw-r--r--src/backend/commands/dbcommands.c8
-rw-r--r--src/include/pg_config.h.in3
4 files changed, 12 insertions, 8 deletions
diff --git a/configure b/configure
index bbacefe8a75..84e47dc2b08 100755
--- a/configure
+++ b/configure
@@ -3577,7 +3577,7 @@ else
then
echo '%%' > conftest.l
if $pgac_candidate -t conftest.l 2>/dev/null | grep FLEX_SCANNER >/dev/null 2>&1; then
- if $pgac_candidate --version | grep '2\.5\.3$' >/dev/null 2>&1; then
+ if $pgac_candidate --version | grep ' 2\.5\.3$' >/dev/null 2>&1; then
pgac_broken_flex=$pgac_candidate
continue
fi
@@ -10305,7 +10305,8 @@ test $ac_cv_func_memcmp_working = no && LIBOBJS="$LIBOBJS memcmp.$ac_objext"
-for ac_func in cbrt dlopen fcvt fdatasync getpeereid memmove poll pstat setproctitle setsid sigprocmask sysconf utime utimes waitpid
+
+for ac_func in cbrt dlopen fcvt fdatasync getpeereid memmove poll pstat setproctitle setsid sigprocmask symlink sysconf utime utimes waitpid
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
diff --git a/configure.in b/configure.in
index 10843597a59..e31eb5db78e 100644
--- a/configure.in
+++ b/configure.in
@@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script.
-dnl $Header: /cvsroot/pgsql/configure.in,v 1.244 2003/04/24 21:16:42 tgl Exp $
+dnl $Header: /cvsroot/pgsql/configure.in,v 1.245 2003/05/07 03:47:08 momjian Exp $
dnl
dnl Developers, please strive to achieve this order:
dnl
@@ -779,7 +779,7 @@ PGAC_FUNC_GETTIMEOFDAY_1ARG
# SunOS doesn't handle negative byte comparisons properly with +/- return
AC_FUNC_MEMCMP
-AC_CHECK_FUNCS([cbrt dlopen fcvt fdatasync getpeereid memmove poll pstat setproctitle setsid sigprocmask sysconf utime utimes waitpid])
+AC_CHECK_FUNCS([cbrt dlopen fcvt fdatasync getpeereid memmove poll pstat setproctitle setsid sigprocmask symlink sysconf utime utimes waitpid])
AC_CHECK_DECLS(fdatasync, [], [], [#include <unistd.h>])
diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c
index 6a680bc1a19..1c3b554c291 100644
--- a/src/backend/commands/dbcommands.c
+++ b/src/backend/commands/dbcommands.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.113 2003/05/04 04:42:52 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.114 2003/05/07 03:47:08 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -174,8 +174,8 @@ createdb(const CreatedbStmt *stmt)
/* don't call this in a transaction block */
PreventTransactionChain((void *) stmt, "CREATE DATABASE");
-#ifdef WIN32
- if (dbpath != NULL) /* platform has no symlinks */
+#ifndef HAVE_SYMLINK
+ if (dbpath != NULL)
elog(ERROR, "CREATE DATABASE: may not use an alternate location on this platform");
#endif
@@ -301,7 +301,7 @@ createdb(const CreatedbStmt *stmt)
/* Make the symlink, if needed */
if (alt_loc)
{
-#ifndef WIN32 /* already throws error on WIN32 above */
+#ifdef HAVE_SYMLINK /* already throws error above */
if (symlink(alt_loc, nominal_loc) != 0)
#endif
elog(ERROR, "CREATE DATABASE: could not link '%s' to '%s': %m",
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index b54b6f9d2a0..838abafffc6 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -414,6 +414,9 @@
/* Define to 1 if you have the <SupportDefs.h> header file. */
#undef HAVE_SUPPORTDEFS_H
+/* Define to 1 if you have the `symlink' function. */
+#undef HAVE_SYMLINK
+
/* Define to 1 if you have the `sysconf' function. */
#undef HAVE_SYSCONF