File tree Expand file tree Collapse file tree 4 files changed +28
-7
lines changed Expand file tree Collapse file tree 4 files changed +28
-7
lines changed Original file line number Diff line number Diff line change @@ -12060,7 +12060,13 @@ LIBOBJS="$LIBOBJS copydir.$ac_objext"
1206012060LIBOBJS="$LIBOBJS gettimeofday.$ac_objext"
1206112061LIBOBJS="$LIBOBJS kill.$ac_objext"
1206212062LIBOBJS="$LIBOBJS open.$ac_objext"
12063- LIBOBJS="$LIBOBJS rand.$ac_objext" ;;
12063+ LIBOBJS="$LIBOBJS rand.$ac_objext"
12064+
12065+ cat >>confdefs.h <<\_ACEOF
12066+ #define HAVE_SYMLINK 1
12067+ _ACEOF
12068+
12069+ ;;
1206412070esac
1206512071
1206612072if test "$with_readline" = yes; then
Original file line number Diff line number Diff line change 11dnl Process this file with autoconf to produce a configure script.
2- dnl $PostgreSQL: pgsql/configure.in,v 1.371 2004/08/04 21:33:35 tgl Exp $
2+ dnl $PostgreSQL: pgsql/configure.in,v 1.372 2004/08/08 01:31:09 momjian Exp $
33dnl
44dnl Developers, please strive to achieve this order:
55dnl
@@ -908,7 +908,10 @@ AC_LIBOBJ(copydir)
908908AC_LIBOBJ(gettimeofday)
909909AC_LIBOBJ(kill)
910910AC_LIBOBJ(open)
911- AC_LIBOBJ(rand) ;;
911+ AC_LIBOBJ(rand)
912+ AC_DEFINE([HAVE_SYMLINK], 1,
913+ [Define to 1 if you have the `symlink' function.])
914+ ;;
912915esac
913916
914917if test "$with_readline" = yes; then
Original file line number Diff line number Diff line change 4545 *
4646 *
4747 * IDENTIFICATION
48- * $PostgreSQL: pgsql/src/backend/commands/tablespace.c,v 1.7 2004/08/01 20:30:48 tgl Exp $
48+ * $PostgreSQL: pgsql/src/backend/commands/tablespace.c,v 1.8 2004/08/08 01:31:11 momjian Exp $
4949 *
5050 *-------------------------------------------------------------------------
5151 */
@@ -482,11 +482,20 @@ DropTableSpace(DropTableSpaceStmt *stmt)
482482 errmsg ("could not unlink file \"%s\": %m" ,
483483 subfile )));
484484
485+ #ifndef WIN32
485486 if (unlink (location ) < 0 )
486487 ereport (ERROR ,
487488 (errcode_for_file_access (),
488489 errmsg ("could not unlink symbolic link \"%s\": %m" ,
489490 location )));
491+ #else
492+ /* The junction is a directory, not a file */
493+ if (rmdir (location ) < 0 )
494+ ereport (ERROR ,
495+ (errcode_for_file_access (),
496+ errmsg ("could not remove junction dir \"%s\": %m" ,
497+ location )));
498+ #endif
490499
491500 pfree (subfile );
492501 pfree (location );
Original file line number Diff line number Diff line change 1010 * Win32 (NT, Win2k, XP). replace() doesn't work on Win95/98/Me.
1111 *
1212 * IDENTIFICATION
13- * $PostgreSQL: pgsql/src/port/dirmod.c,v 1.14 2004/08/07 21:48:09 momjian Exp $
13+ * $PostgreSQL: pgsql/src/port/dirmod.c,v 1.15 2004/08/08 01:31:15 momjian Exp $
1414 *
1515 *-------------------------------------------------------------------------
1616 */
@@ -153,9 +153,9 @@ pgsymlink(const char *oldpath, const char *newpath)
153153{
154154 HANDLE dirhandle ;
155155 DWORD len ;
156- char * p = nativeTarget ;
157156 char buffer [MAX_PATH * sizeof (WCHAR ) + sizeof (REPARSE_JUNCTION_DATA_BUFFER )];
158157 char nativeTarget [MAX_PATH ];
158+ char * p = nativeTarget ;
159159 REPARSE_JUNCTION_DATA_BUFFER * reparseBuf = (REPARSE_JUNCTION_DATA_BUFFER * )buffer ;
160160
161161 CreateDirectory (newpath , 0 );
@@ -203,9 +203,12 @@ pgsymlink(const char *oldpath, const char *newpath)
203203 NULL , GetLastError (),
204204 MAKELANGID (LANG_NEUTRAL , SUBLANG_DEFAULT ),
205205 (LPSTR )& msg , 0 , NULL );
206+ #ifdef FRONTEND
207+ fprintf (stderr , "Error setting junction for %s: %s" , nativeTarget , msg );
208+ #else
206209 ereport (ERROR , (errcode_for_file_access (),
207210 errmsg ("Error setting junction for %s: %s" , nativeTarget , msg )));
208-
211+ #endif
209212 LocalFree (msg );
210213
211214 CloseHandle (dirhandle );
You can’t perform that action at this time.
0 commit comments