summaryrefslogtreecommitdiff
path: root/src/bin/pg_passwd/pg_passwd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/pg_passwd/pg_passwd.c')
-rw-r--r--src/bin/pg_passwd/pg_passwd.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/bin/pg_passwd/pg_passwd.c b/src/bin/pg_passwd/pg_passwd.c
index de9ffd65a7..0718a3153b 100644
--- a/src/bin/pg_passwd/pg_passwd.c
+++ b/src/bin/pg_passwd/pg_passwd.c
@@ -63,7 +63,11 @@ read_pwd_file(char *filename)
int i;
try_again:
+#ifndef __CYGWIN32__
fp = fopen(filename, "r");
+#else
+ fp = fopen(filename, "rb");
+#endif
if (fp == NULL)
{
if (errno == ENOENT)
@@ -75,7 +79,11 @@ try_again:
{
case 'y':
case 'Y':
+#ifndef __CYGWIN32__
fp = fopen(filename, "w");
+#else
+ fp = fopen(filename, "wb");
+#endif
if (fp == NULL)
{
perror(filename);
@@ -193,7 +201,11 @@ link_again:
}
/* open file */
+#ifndef __CYGWIN32__
if ((fp = fopen(filename, "w")) == NULL)
+#else
+ if ((fp = fopen(filename, "wb")) == NULL)
+#endif
{
perror(filename);
exit(1);