From a855c90a72d2a6aed975ba5a51868f41f6578be8 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Wed, 19 Nov 2014 11:57:54 -0500 Subject: [PATCH] Avoid file descriptor leak in pg_test_fsync. 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 | 2 -- 1 file changed, 2 deletions(-) diff --git a/contrib/pg_test_fsync/pg_test_fsync.c b/contrib/pg_test_fsync/pg_test_fsync.c index 3791f5a0719..43b494cdf1b 100644 --- a/contrib/pg_test_fsync/pg_test_fsync.c +++ b/contrib/pg_test_fsync/pg_test_fsync.c @@ -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++) {