Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
16d1c9f5
Commit
16d1c9f5
authored
Oct 28, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Main: catch exceptions in all of main()
parent
0c464b24
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
19 deletions
+17
-19
Main.cxx
src/Main.cxx
+17
-19
No files found.
src/Main.cxx
View file @
16d1c9f5
...
@@ -389,7 +389,7 @@ static int mpd_main_after_fork(struct options);
...
@@ -389,7 +389,7 @@ static int mpd_main_after_fork(struct options);
static
inline
static
inline
#endif
#endif
int
mpd_main
(
int
argc
,
char
*
argv
[])
int
mpd_main
(
int
argc
,
char
*
argv
[])
{
try
{
struct
options
options
;
struct
options
options
;
Error
error
;
Error
error
;
...
@@ -414,28 +414,23 @@ int mpd_main(int argc, char *argv[])
...
@@ -414,28 +414,23 @@ int mpd_main(int argc, char *argv[])
io_thread_init
();
io_thread_init
();
config_global_init
();
config_global_init
();
try
{
#ifdef ANDROID
#ifdef ANDROID
(
void
)
argc
;
(
void
)
argc
;
(
void
)
argv
;
(
void
)
argv
;
const
auto
sdcard
=
Environment
::
getExternalStorageDirectory
();
const
auto
sdcard
=
Environment
::
getExternalStorageDirectory
();
if
(
!
sdcard
.
IsNull
())
{
if
(
!
sdcard
.
IsNull
())
{
const
auto
config_path
=
const
auto
config_path
=
AllocatedPath
::
Build
(
sdcard
,
"mpd.conf"
);
AllocatedPath
::
Build
(
sdcard
,
"mpd.conf"
);
if
(
FileExists
(
config_path
))
if
(
FileExists
(
config_path
))
ReadConfigFile
(
config_path
);
ReadConfigFile
(
config_path
);
}
}
#else
#else
if
(
!
parse_cmdline
(
argc
,
argv
,
&
options
,
error
))
{
if
(
!
parse_cmdline
(
argc
,
argv
,
&
options
,
error
))
{
LogError
(
error
);
LogError
(
error
);
return
EXIT_FAILURE
;
}
#endif
}
catch
(
const
std
::
exception
&
e
)
{
LogError
(
e
);
return
EXIT_FAILURE
;
return
EXIT_FAILURE
;
}
}
#endif
#ifdef ENABLE_DAEMON
#ifdef ENABLE_DAEMON
if
(
!
glue_daemonize_init
(
&
options
,
error
))
{
if
(
!
glue_daemonize_init
(
&
options
,
error
))
{
...
@@ -496,6 +491,9 @@ int mpd_main(int argc, char *argv[])
...
@@ -496,6 +491,9 @@ int mpd_main(int argc, char *argv[])
#else
#else
return
mpd_main_after_fork
(
options
);
return
mpd_main_after_fork
(
options
);
#endif
#endif
}
catch
(
const
std
::
exception
&
e
)
{
LogError
(
e
);
return
EXIT_FAILURE
;
}
}
static
int
mpd_main_after_fork
(
struct
options
options
)
static
int
mpd_main_after_fork
(
struct
options
options
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment