Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
Icecast-Server
Commits
a66e69cb
Commit
a66e69cb
authored
Apr 07, 2004
by
Michael Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Give details in error messages on failure to open log files.
svn path=/icecast/trunk/icecast/; revision=6495
parent
cdda32a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
9 deletions
+17
-9
src/main.c
src/main.c
+17
-9
No files found.
src/main.c
View file @
a66e69cb
...
...
@@ -183,7 +183,7 @@ static int _start_logging(void)
{
char
fn_error
[
FILENAME_MAX
];
char
fn_access
[
FILENAME_MAX
];
char
p
buf
[
1024
];
char
buf
[
1024
];
ice_config_t
*
config
=
config_get_config_unlocked
();
...
...
@@ -193,24 +193,32 @@ static int _start_logging(void)
}
else
{
errorlog
=
log_open_file
(
stderr
);
}
if
(
errorlog
<
0
)
{
buf
[
sizeof
(
buf
)
-
1
]
=
0
;
snprintf
(
buf
,
sizeof
(
buf
)
-
1
,
"FATAL: could not open error logging: %s"
,
strerror
(
errno
));
_fatal_error
(
buf
);
}
log_set_level
(
errorlog
,
config
->
loglevel
);
if
(
strcmp
(
config
->
access_log
,
"-"
))
{
snprintf
(
fn_access
,
FILENAME_MAX
,
"%s%s%s"
,
config
->
log_dir
,
PATH_SEPARATOR
,
config
->
access_log
);
accesslog
=
log_open
(
fn_access
);
}
else
{
accesslog
=
log_open_file
(
stderr
);
}
if
(
accesslog
<
0
)
{
buf
[
sizeof
(
buf
)
-
1
]
=
0
;
snprintf
(
buf
,
sizeof
(
buf
)
-
1
,
"FATAL: could not open access logging: %s"
,
strerror
(
errno
));
_fatal_error
(
buf
);
}
log_set_level
(
errorlog
,
config
->
loglevel
);
log_set_level
(
accesslog
,
4
);
if
(
errorlog
<
0
)
{
_fatal_error
(
"FATAL: could not open error logging"
);
}
if
(
accesslog
<
0
)
{
memset
(
pbuf
,
'\000'
,
sizeof
(
pbuf
));
snprintf
(
pbuf
,
sizeof
(
pbuf
)
-
1
,
"FATAL: could not open access logging"
);
_fatal_error
(
pbuf
);
}
if
(
errorlog
>=
0
&&
accesslog
>=
0
)
return
1
;
return
0
;
...
...
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