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/utils/version.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/utils/version.c') diff --git a/src/utils/version.c b/src/utils/version.c index aef5de8b48..7dafe60b31 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)); -- cgit v1.2.1