diff --git a/src/include/port.h b/src/include/port.h
index b81fa4a89eb1130c6431bb41c80ee58198df893d..8a63958535b39963cfc410ac1cfede1c5b215468 100644
--- a/src/include/port.h
+++ b/src/include/port.h
@@ -251,7 +251,7 @@ extern int	pgunlink(const char *path);
 #if defined(WIN32) && !defined(__CYGWIN__)
 extern int	pgsymlink(const char *oldpath, const char *newpath);
 extern int	pgreadlink(const char *path, char *buf, size_t size);
-extern bool pgwin32_is_junction(char *path);
+extern bool pgwin32_is_junction(const char *path);
 
 #define symlink(oldpath, newpath)	pgsymlink(oldpath, newpath)
 #define readlink(path, buf, size)	pgreadlink(path, buf, size)
diff --git a/src/port/dirmod.c b/src/port/dirmod.c
index fe2b815ff6a3f0160b9b3668b2a4239686e86ff3..aaf496df66733029ec53f2312599fabec22bee17 100644
--- a/src/port/dirmod.c
+++ b/src/port/dirmod.c
@@ -338,10 +338,10 @@ pgreadlink(const char *path, char *buf, size_t size)
 
 /*
  * Assumes the file exists, so will return false if it doesn't
- * (since a nonexistant file is not a junction)
+ * (since a nonexistent file is not a junction)
  */
 bool
-pgwin32_is_junction(char *path)
+pgwin32_is_junction(const char *path)
 {
 	DWORD		attr = GetFileAttributes(path);