Commit 271e49db authored by Max Kellermann's avatar Max Kellermann

Main: move code to MainOrThrow(), leaving exception handler in mpd_main()

parent 8d2101cc
...@@ -446,11 +446,9 @@ int main(int argc, char *argv[]) ...@@ -446,11 +446,9 @@ int main(int argc, char *argv[])
static int static int
mpd_main_after_fork(const ConfigData &raw_config, const Config &config); mpd_main_after_fork(const ConfigData &raw_config, const Config &config);
#ifdef ANDROID static inline int
static inline MainOrThrow(int argc, char *argv[])
#endif {
int mpd_main(int argc, char *argv[])
try {
struct options options; struct options options;
#ifdef ENABLE_DAEMON #ifdef ENABLE_DAEMON
...@@ -529,10 +527,19 @@ try { ...@@ -529,10 +527,19 @@ try {
#endif #endif
return mpd_main_after_fork(raw_config, config); return mpd_main_after_fork(raw_config, config);
}
} catch (const std::exception &e) { #ifdef ANDROID
static inline
#endif
int mpd_main(int argc, char *argv[])
{
try {
return MainOrThrow(argc, argv);
} catch (const std::exception &e) {
LogError(e); LogError(e);
return EXIT_FAILURE; return EXIT_FAILURE;
}
} }
static int static int
......
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