Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libbluray
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
VideoLAN
libbluray
Commits
4dd034a6
Commit
4dd034a6
authored
Mar 27, 2010
by
hpi1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not replace application's stderr when BD_DEBUG_FILE is used.
parent
c2acb0da
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
src/util/logging.c
src/util/logging.c
+8
-5
No files found.
src/util/logging.c
View file @
4dd034a6
...
...
@@ -6,6 +6,7 @@
char
out
[
512
];
debug_mask_t
debug_mask
=
0
;
static
int
debug_init
=
0
;
FILE
*
logfile
=
NULL
;
char
*
print_hex
(
uint8_t
*
buf
,
int
count
)
...
...
@@ -22,10 +23,10 @@ char *print_hex(uint8_t *buf, int count)
void
debug
(
char
*
file
,
int
line
,
uint32_t
mask
,
const
char
*
format
,
...)
{
char
*
env
;
// Only call getenv() once.
if
(
!
debug_init
)
{
char
*
env
;
debug_init
=
1
;
if
((
env
=
getenv
(
"BD_DEBUG_MASK"
)))
{
...
...
@@ -36,10 +37,12 @@ void debug(char *file, int line, uint32_t mask, const char *format, ...)
// Send DEBUG to file?
if
((
env
=
getenv
(
"BD_DEBUG_FILE"
)))
{
freopen
(
env
,
"wb"
,
stderr
);
setvbuf
(
stderr
,
NULL
,
_IOLBF
,
0
);
logfile
=
fopen
(
env
,
"wb"
);
setvbuf
(
logfile
,
NULL
,
_IOLBF
,
0
);
}
if
(
!
logfile
)
logfile
=
stderr
;
}
if
(
mask
&
debug_mask
)
{
...
...
@@ -50,6 +53,6 @@ void debug(char *file, int line, uint32_t mask, const char *format, ...)
vsprintf
(
buffer
,
format
,
args
);
va_end
(
args
);
fprintf
(
stderr
,
"%s:%d: %s"
,
file
,
line
,
buffer
);
fprintf
(
logfile
,
"%s:%d: %s"
,
file
,
line
,
buffer
);
}
}
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