summaryrefslogtreecommitdiff
path: root/include/my_default.h
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2018-03-15 15:34:45 +0400
committerSergey Vojtovich <svoj@mariadb.org>2018-03-16 13:26:52 +0400
commit0a534348c75cf435d2017959855de2efa798fd0b (patch)
tree48c7ee2f194ccf375877e4be7014c56e6adf8601 /include/my_default.h
parent7033af9e81a69d75199faa028f8959667f755551 (diff)
downloadmariadb-git-0a534348c75cf435d2017959855de2efa798fd0b.tar.gz
MDEV-14265 - RPMLint warning: shared-lib-calls-exit
Eliminated last exit() call from libmysqld.
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 */