Commit 502eb4d9 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Andrei Vagin

restore: Add add_post_prepare_cb_once helper

Reviewed-by: 's avatarKirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 58592064
......@@ -25,4 +25,17 @@ extern int cr_dedup(void);
extern int check_add_feature(char *arg);
extern void pr_check_features(const char *offset, const char *sep, int width);
#define add_post_prepare_cb_once(actor, data) \
({ \
static int __cb_called = 0; \
int ret = 0; \
\
if (!__cb_called) { \
ret = add_post_prepare_cb(actor, data); \
__cb_called = 1; \
} \
\
ret; \
})
#endif /* __CR_CRTOOLS_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment