Avoid file descriptor leak in pg_test_fsync.
authorRobert Haas
Wed, 19 Nov 2014 16:57:54 +0000 (11:57 -0500)
committerRobert Haas
Wed, 19 Nov 2014 17:13:14 +0000 (12:13 -0500)
This can cause problems on Windows, where files that are still open
can't be unlinked.

Jeff Janes

contrib/pg_test_fsync/pg_test_fsync.c

index 842295ae3d97681e24cf903f99be767b9620a7ca..37298be56e623c0b531b9fffd23a38de58d064c2 100644 (file)
@@ -259,8 +259,6 @@ test_sync(int writes_per_op)
    }
    else
    {
-       if ((tmpfile = open(filename, O_RDWR | O_DSYNC | PG_O_DIRECT, 0)) == -1)
-           die("could not open output file");
        START_TIMER;
        for (ops = 0; alarm_triggered == false; ops++)
        {