summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_ism.h
diff options
context:
space:
mode:
authorajs <ajs>2005-11-16 20:33:22 +0100
committerajs <ajs>2005-11-16 20:33:22 +0100
commit70cd34749f3c57d6f67ab31a9552c46afe437553 (patch)
treecbb09a4e97d559ae0806134a94313e7352821741 /ospfd/ospf_ism.h
parent[workqueue] Update workqueue users callbacks to additional arguments (diff)
downloadfrr-70cd34749f3c57d6f67ab31a9552c46afe437553.tar.xz
frr-70cd34749f3c57d6f67ab31a9552c46afe437553.zip
[ospfd] Make OSPF_ISM_TIMER_OFF macro safer.
2005-11-16 Andrew J. Schorr <ajschorr@alumni.princeton.edu> * ospf_ism.h: (OSPF_ISM_TIMER_OFF) Improve macro syntax by enclosing in 'do {...} while(0)'.
Diffstat (limited to 'ospfd/ospf_ism.h')
-rw-r--r--ospfd/ospf_ism.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/ospfd/ospf_ism.h b/ospfd/ospf_ism.h
index c714a15c7..f0357a482 100644
--- a/ospfd/ospf_ism.h
+++ b/ospfd/ospf_ism.h
@@ -90,11 +90,13 @@
/* Macro for OSPF ISM timer turn off. */
#define OSPF_ISM_TIMER_OFF(X) \
- if (X) \
- { \
- thread_cancel (X); \
- (X) = NULL; \
- }
+ do { \
+ if (X) \
+ { \
+ thread_cancel (X); \
+ (X) = NULL; \
+ } \
+ } while (0)
/* Macro for OSPF schedule event. */
#define OSPF_ISM_EVENT_SCHEDULE(I,E) \