Skip to content

Commit 33e381b

Browse files
committed
chore: exit in ONCE()
1 parent 722397c commit 33e381b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

include/once.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
#define ONCE() \
55
do { \
66
static int _called_once_flag_##__LINE__ = 0; \
7-
if (_called_once_flag_##__LINE__) \
7+
if (_called_once_flag_##__LINE__) { \
88
wlr_log(WLR_ERROR, "Function %s called more than once", __func__); \
9+
exit(1); \
10+
} \
911
_called_once_flag_##__LINE__ = 1; \
1012
} while(0)
1113
#else

0 commit comments

Comments
 (0)