]> granicus.if.org Git - postgresql/commitdiff
Avoid file descriptor leak in pg_test_fsync.
authorRobert Haas <rhaas@postgresql.org>
Wed, 19 Nov 2014 16:57:54 +0000 (11:57 -0500)
committerRobert Haas <rhaas@postgresql.org>
Wed, 19 Nov 2014 17:26:06 +0000 (12:26 -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 3791f5a07193570af73bbd1add31a079804abda2..43b494cdf1bda0eb061560563ff6955f4f9879c1 100644 (file)
@@ -206,8 +206,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");
                gettimeofday(&start_t, NULL);
                for (ops = 0; ops < ops_per_test; ops++)
                {