Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
6693060b
Commit
6693060b
authored
Feb 25, 2008
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use strerror_r() which is guaranteed to be thread safe, using the GNU prototype only when available
parent
44cfc603
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
src/misc/threads.c
src/misc/threads.c
+10
-3
No files found.
src/misc/threads.c
View file @
6693060b
...
...
@@ -95,16 +95,23 @@ static inline unsigned long vlc_threadid (void)
void
vlc_pthread_fatal
(
const
char
*
action
,
int
error
,
const
char
*
file
,
unsigned
line
)
{
char
buf
[
1000
];
const
char
*
msg
;
fprintf
(
stderr
,
"LibVLC fatal error %s in thread %lu at %s:%u: %d
\n
"
,
action
,
vlc_threadid
(),
file
,
line
,
error
);
fflush
(
stderr
);
/* Sometimes strerror() crashes too, so make sure we print an error
/* Sometimes strerror
_r
() crashes too, so make sure we print an error
* message before we invoke it */
msg
=
strerror
(
error
);
fprintf
(
stderr
,
"Error description was:
\"
%s
\"\n
"
,
msg
?
msg
:
"(null)"
);
#ifdef __GLIBC__ && _POSIX_C_SOURCE < 200112L && _XOPEN_SOURCE < 600 && _GNU_SOURCE
/* use GNU prototype */
msg
=
strerror_r
(
error
,
buf
,
sizeof
(
buf
));
#else
msg
=
buf
;
if
(
!
strerror_r
(
error
,
buf
,
sizeof
(
buf
)))
#endif
fprintf
(
stderr
,
"Error description:
\"
%s
\"\n
"
,
msg
?
msg
:
"(null)"
);
fflush
(
stderr
);
abort
();
}
...
...
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