aboutsummaryrefslogtreecommitdiff
path: root/src/utils/version.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>1999-01-17 06:20:06 +0000
committerBruce Momjian <bruce@momjian.us>1999-01-17 06:20:06 +0000
commit7a6b562fdf60f1d1ebe9e2bc154d0ffd56dab2d1 (patch)
tree1e24049a7bedd03a13776dc131e808ae97eca197 /src/utils/version.c
parent298682d9e0b0ec55d5f72cec1f4d43c23f2a1ac6 (diff)
downloadpostgresql-7a6b562fdf60f1d1ebe9e2bc154d0ffd56dab2d1.tar.gz
postgresql-7a6b562fdf60f1d1ebe9e2bc154d0ffd56dab2d1.zip
Apply Win32 patch from Horak Daniel.
Diffstat (limited to 'src/utils/version.c')
-rw-r--r--src/utils/version.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/utils/version.c b/src/utils/version.c
index aef5de8b48a..7dafe60b313 100644
--- a/src/utils/version.c
+++ b/src/utils/version.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/utils/Attic/version.c,v 1.9 1998/04/29 12:41:29 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/utils/Attic/version.c,v 1.10 1999/01/17 06:20:06 momjian Exp $
*
* NOTES
* XXX eventually, should be able to handle version identifiers
@@ -68,7 +68,11 @@ ValidatePgVersion(const char *path, char **reason_p)
PathSetVersionFilePath(path, full_path);
+#ifndef __CYGWIN32__
if ((fd = open(full_path, O_RDONLY, 0)) == -1)
+#else
+ if ((fd = open(full_path, O_RDONLY | O_BINARY, 0)) == -1)
+#endif
{
*reason_p = malloc(200);
sprintf(*reason_p, "File '%s' does not exist or no read permission.", full_path);
@@ -123,7 +127,11 @@ SetPgVersion(const char *path, char **reason_p)
PathSetVersionFilePath(path, full_path);
+#ifndef __CYGWIN32__
fd = open(full_path, O_WRONLY | O_CREAT | O_EXCL, 0666);
+#else
+ fd = open(full_path, O_WRONLY | O_CREAT | O_EXCL | O_BINARY, 0666);
+#endif
if (fd < 0)
{
*reason_p = malloc(100 + strlen(full_path));