diff --git a/contrib/pg_test_fsync/pg_test_fsync.c b/contrib/pg_test_fsync/pg_test_fsync.c
index 9fe2301e419a569d6f6111c606a22c01c2690c9a..dfb21727960062f2d85184f824fee6fa2e1d339b 100644
--- a/contrib/pg_test_fsync/pg_test_fsync.c
+++ b/contrib/pg_test_fsync/pg_test_fsync.c
@@ -258,8 +258,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++)
 		{