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
9614c48e
Commit
9614c48e
authored
Dec 04, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LogInit: throw exception instead of calling FatalError()
parent
c6e1ca1c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
+5
-8
LogInit.cxx
src/LogInit.cxx
+5
-8
No files found.
src/LogInit.cxx
View file @
9614c48e
...
...
@@ -24,12 +24,10 @@
#include "config/Param.hxx"
#include "config/ConfigGlobal.hxx"
#include "config/ConfigOption.hxx"
#include "system/FatalError.hxx"
#include "fs/AllocatedPath.hxx"
#include "fs/FileSystem.hxx"
#include "util/Domain.hxx"
#include "util/RuntimeError.hxx"
#include "system/FatalError.hxx"
#include "system/Error.hxx"
#include <assert.h>
...
...
@@ -54,9 +52,9 @@ static void redirect_logs(int fd)
{
assert
(
fd
>=
0
);
if
(
dup2
(
fd
,
STDOUT_FILENO
)
<
0
)
FatalSystemError
(
"Failed to dup2 stdout"
);
throw
MakeErrno
(
"Failed to dup2 stdout"
);
if
(
dup2
(
fd
,
STDERR_FILENO
)
<
0
)
FatalSystemError
(
"Failed to dup2 stderr"
);
throw
MakeErrno
(
"Failed to dup2 stderr"
);
}
static
int
...
...
@@ -98,10 +96,9 @@ parse_log_level(const char *value, int line)
return
LOG_LEVEL_SECURE
;
else
if
(
0
==
strcmp
(
value
,
"verbose"
))
return
LogLevel
::
DEBUG
;
else
{
FormatFatalError
(
"unknown log level
\"
%s
\"
at line %d"
,
value
,
line
);
}
else
throw
FormatRuntimeError
(
"unknown log level
\"
%s
\"
at line %d"
,
value
,
line
);
}
#endif
...
...
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