1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-30 06:01:21 +03:00

Apply Win32 patch from Horak Daniel.

This commit is contained in:
Bruce Momjian
1999-01-17 06:20:06 +00:00
parent 298682d9e0
commit 7a6b562fdf
58 changed files with 484 additions and 86 deletions

View File

@@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.66 1999/01/11 03:56:05 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.67 1999/01/17 06:18:15 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -250,7 +250,11 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
}
else
{
#ifndef __CYGWIN32__
fp = AllocateFile(filename, "r");
#else
fp = AllocateFile(filename, "rb");
#endif
if (fp == NULL)
elog(ERROR, "COPY command, running in backend with "
"effective uid %d, could not open file '%s' for "
@@ -277,7 +281,11 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
mode_t oumask; /* Pre-existing umask value */
oumask = umask((mode_t) 0);
#ifndef __CYGWIN32__
fp = AllocateFile(filename, "w");
#else
fp = AllocateFile(filename, "wb");
#endif
umask(oumask);
if (fp == NULL)
elog(ERROR, "COPY command, running in backend with "

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.28 1998/12/15 12:45:55 vadim Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.29 1999/01/17 06:18:17 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -305,7 +305,11 @@ stop_vacuum(char *dbpath, char *dbname)
else
snprintf(filename, 256, "%s%c%s.vacuum", dbpath, SEP_CHAR, dbname);
#ifndef __CYGWIN32__
if ((fp = AllocateFile(filename, "r")) != NULL)
#else
if ((fp = AllocateFile(filename, "rb")) != NULL)
#endif
{
fscanf(fp, "%d", &pid);
FreeFile(fp);

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.92 1998/12/15 12:46:01 vadim Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.93 1999/01/17 06:18:18 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -187,7 +187,11 @@ vc_init()
{
int fd;
#ifndef __CYGWIN32__
if ((fd = open("pg_vlock", O_CREAT | O_EXCL, 0600)) < 0)
#else
if ((fd = open("pg_vlock", O_CREAT | O_EXCL | O_BINARY, 0600)) < 0)
#endif
{
elog(ERROR, "Can't create lock file. Is another vacuum cleaner running?\n\
\tIf not, you may remove the pg_vlock file in the %s\n\