summaryrefslogtreecommitdiff
path: root/include/my_default.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/my_default.h')
-rw-r--r--include/my_default.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/my_default.h b/include/my_default.h
index 0ed94b09492..bd3a21f03a8 100644
--- a/include/my_default.h
+++ b/include/my_default.h
@@ -45,6 +45,13 @@ extern void free_defaults(char **argv);
extern void my_print_default_files(const char *conf_file);
extern void print_defaults(const char *conf_file, const char **groups);
+
+/** Simplify load_defaults() common use */
+#define load_defaults_or_exit(A, B, C, D) switch (load_defaults(A, B, C, D)) { \
+ case 0: break; \
+ case 4: my_end(0); exit(0); \
+ default: my_end(0); exit(1); }
+
C_MODE_END
#endif /* MY_DEFAULT_INCLUDED */