From e81541398a85fda6e4e2ec1be3fcf0ded96696da Mon Sep 17 00:00:00 2001 From: Thadeu Lima de Souza Cascardo Date: Fri, 24 Jul 2015 12:22:56 -0300 Subject: [PATCH] perf-counter: Fix segfaults on non-Linux platforms. Commit 0eee08dbddea520536197657da7a0b (perf-counter: simplify the performance macro) introduces the PERF macro, which is empty for non-linux platforms. Added to commit bc487aeff2d6823c088d6e4499e0f53e6651523b (ovsdb: Add per transaction commit instruction counter), that uses such macro, it causes segfaults, since it makes ovsdb_txn_commit return an uninitialized pointer as error. Signed-off-by: Thadeu Lima de Souza Cascardo [blp@nicira.com added {} around the macro expansion] Signed-off-by: Ben Pfaff --- lib/perf-counter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/perf-counter.h b/lib/perf-counter.h index ca3aaba73..bdfb672a3 100644 --- a/lib/perf-counter.h +++ b/lib/perf-counter.h @@ -113,7 +113,7 @@ char *perf_counters_to_string(void); perf_counter_accumulate(&c, start_count); \ } #else -#define PERF(name, expr) +#define PERF(name, expr) { expr; } static inline void perf_counters_init(void) {} static inline void perf_counters_destroy(void) {} -- 2.20.1