From 3ae28ce8c437811bba47c09d1212c2d3c41cb7ff Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 22 Jan 2011 12:25:48 -0500 Subject: [PATCH] Suppress unused-variables warning when OPEN_SYNC_FLAG isn't defined. Per buildfarm. --- contrib/pg_test_fsync/pg_test_fsync.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/contrib/pg_test_fsync/pg_test_fsync.c b/contrib/pg_test_fsync/pg_test_fsync.c index 7fbcfcf45f0..e13307f4143 100644 --- a/contrib/pg_test_fsync/pg_test_fsync.c +++ b/contrib/pg_test_fsync/pg_test_fsync.c @@ -391,16 +391,15 @@ test_open_syncs(void) test_open_sync("16 1k open_sync writes", 1); } - -static void -test_open_sync(const char *msg, int writes_size) -{ - int tmpfile, ops, writes; - /* * Test open_sync with different size files */ +static void +test_open_sync(const char *msg, int writes_size) +{ #ifdef OPEN_SYNC_FLAG + int tmpfile, ops, writes; + if ((tmpfile = open(filename, O_RDWR | OPEN_SYNC_FLAG | PG_O_DIRECT, 0)) == -1) printf(NA_FORMAT, "o_direct", "n/a**\n"); else