From 5e01aa7ad122c1b011df7a14370d2c34d53ddeb4 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Sun, 8 Aug 2004 01:31:15 +0000 Subject: Fixups for Win32 symlinks. --- src/backend/commands/tablespace.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/backend/commands/tablespace.c') diff --git a/src/backend/commands/tablespace.c b/src/backend/commands/tablespace.c index 1a9e69dc123..05a13315a1f 100644 --- a/src/backend/commands/tablespace.c +++ b/src/backend/commands/tablespace.c @@ -45,7 +45,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/tablespace.c,v 1.7 2004/08/01 20:30:48 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/commands/tablespace.c,v 1.8 2004/08/08 01:31:11 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -482,11 +482,20 @@ DropTableSpace(DropTableSpaceStmt *stmt) errmsg("could not unlink file \"%s\": %m", subfile))); +#ifndef WIN32 if (unlink(location) < 0) ereport(ERROR, (errcode_for_file_access(), errmsg("could not unlink symbolic link \"%s\": %m", location))); +#else + /* The junction is a directory, not a file */ + if (rmdir(location) < 0) + ereport(ERROR, + (errcode_for_file_access(), + errmsg("could not remove junction dir \"%s\": %m", + location))); +#endif pfree(subfile); pfree(location); -- cgit v1.2.3