diff --git a/src/bin/pg_resetxlog/pg_resetxlog.c b/src/bin/pg_resetxlog/pg_resetxlog.c
index d5d89ec3ad7031ed7a28d659b8dc144e521f19ff..3d9a6698b390434342c195662c56c5953603c770 100644
--- a/src/bin/pg_resetxlog/pg_resetxlog.c
+++ b/src/bin/pg_resetxlog/pg_resetxlog.c
@@ -91,7 +91,6 @@ main(int argc, char *argv[])
 	char	   *endptr;
 	char	   *DataDir;
 	int			fd;
-	char		path[MAXPGPATH];
 
 	set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("pg_resetxlog"));
 
@@ -252,13 +251,12 @@ main(int argc, char *argv[])
 	 * Check for a postmaster lock file --- if there is one, refuse to
 	 * proceed, on grounds we might be interfering with a live installation.
 	 */
-	snprintf(path, MAXPGPATH, "%s/postmaster.pid", DataDir);
-
-	if ((fd = open(path, O_RDONLY, 0)) < 0)
+	if ((fd = open("postmaster.pid", O_RDONLY, 0)) < 0)
 	{
 		if (errno != ENOENT)
 		{
-			fprintf(stderr, _("%s: could not open file \"%s\" for reading: %s\n"), progname, path, strerror(errno));
+			fprintf(stderr, _("%s: could not open file \"%s\" for reading: %s\n"),
+					progname, "postmaster.pid", strerror(errno));
 			exit(1);
 		}
 	}
@@ -266,7 +264,7 @@ main(int argc, char *argv[])
 	{
 		fprintf(stderr, _("%s: lock file \"%s\" exists\n"
 						  "Is a server running?  If not, delete the lock file and try again.\n"),
-				progname, path);
+				progname, "postmaster.pid");
 		exit(1);
 	}