mirror of
https://github.com/postgres/postgres.git
synced 2025-11-12 05:01:15 +03:00
fsync patch from openlink
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Id: fd.c,v 1.1.1.1 1996/07/09 06:21:55 scrappy Exp $
|
||||
* $Id: fd.c,v 1.2 1996/07/15 19:22:07 scrappy Exp $
|
||||
*
|
||||
* NOTES:
|
||||
*
|
||||
@@ -191,6 +191,15 @@ static int FileAccess(File file);
|
||||
static File fileNameOpenFile(FileName fileName, int fileFlags, int fileMode);
|
||||
static char *filepath(char *filename);
|
||||
|
||||
#ifdef OPENLINK_PATCHES
|
||||
pg_fsync(fd)
|
||||
{
|
||||
extern int fsyncOff;
|
||||
return fsyncOff ? 0 : fsync(fd);
|
||||
}
|
||||
#define fsync pg_fsync
|
||||
#endif
|
||||
|
||||
#if defined(FDDEBUG)
|
||||
static void
|
||||
_dump_lru()
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.2 1996/07/09 06:35:38 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.3 1996/07/15 19:22:12 scrappy Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -472,8 +472,12 @@ mdblindwrt(char *dbstr,
|
||||
status = SM_SUCCESS;
|
||||
|
||||
/* write and sync the block */
|
||||
#ifdef OPENLINK_PATCHES
|
||||
if (write(fd, buffer, BLCKSZ) != BLCKSZ || (pg_fsync(fd) < 0))
|
||||
#else
|
||||
if (write(fd, buffer, BLCKSZ) != BLCKSZ || fsync(fd) < 0)
|
||||
status = SM_FAIL;
|
||||
#endif
|
||||
|
||||
if (close(fd) < 0)
|
||||
status = SM_FAIL;
|
||||
|
||||
Reference in New Issue
Block a user