From 7a6b562fdf60f1d1ebe9e2bc154d0ffd56dab2d1 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Sun, 17 Jan 1999 06:20:06 +0000 Subject: Apply Win32 patch from Horak Daniel. --- src/bin/pg_passwd/pg_passwd.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/bin/pg_passwd/pg_passwd.c') 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); -- cgit v1.2.1