>From 2b7eb360cd8789bb75cc9c02b85b1df6a9903f0f Mon Sep 17 00:00:00 2001
From: Abhijit Menon-Sen <ams@2ndQuadrant.com>
Date: Wed, 24 Sep 2014 16:07:06 +0530
Subject: Add const to FileName typedef, make fsync_fname use it

The filename arguments aren't modified anyway, and this avoids warnings
when fsync_fname is called from ResetUnloggedRelationsInDbspaceDir. It
is also consistent with several other functions in fd.c that already
take const char * arguments.
---
 src/backend/storage/file/fd.c | 2 +-
 src/include/storage/fd.h      | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c
index 1f69c9e..33ab471 100644
--- a/src/backend/storage/file/fd.c
+++ b/src/backend/storage/file/fd.c
@@ -390,7 +390,7 @@ pg_flush_data(int fd, off_t offset, off_t amount)
  * indicate the OS just doesn't allow/require fsyncing directories.
  */
 void
-fsync_fname(char *fname, bool isdir)
+fsync_fname(FileName fname, bool isdir)
 {
 	int			fd;
 	int			returncode;
diff --git a/src/include/storage/fd.h b/src/include/storage/fd.h
index a6df8fb..2fa4e18 100644
--- a/src/include/storage/fd.h
+++ b/src/include/storage/fd.h
@@ -46,7 +46,7 @@
  * FileSeek uses the standard UNIX lseek(2) flags.
  */
 
-typedef char *FileName;
+typedef const char *FileName;
 
 typedef int File;
 
@@ -113,7 +113,7 @@ extern int	pg_fsync_no_writethrough(int fd);
 extern int	pg_fsync_writethrough(int fd);
 extern int	pg_fdatasync(int fd);
 extern int	pg_flush_data(int fd, off_t offset, off_t amount);
-extern void fsync_fname(char *fname, bool isdir);
+extern void fsync_fname(FileName fname, bool isdir);
 
 /* Filename components for OpenTemporaryFile */
 #define PG_TEMP_FILES_DIR "pgsql_tmp"
-- 
1.9.1

