Commit c3bd7793 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont
Browse files

posix: simplify thread error handler

parent 9d12638c
......@@ -162,31 +162,7 @@ vlc_thread_fatal (const char *action, int error,
fprintf (stderr, "LibVLC fatal error %s (%d) in thread %lu ",
action, error, vlc_threadid ());
vlc_trace (function, file, line);
/* Sometimes strerror_r() crashes too, so make sure we print an error
* message before we invoke it */
#ifdef __GLIBC__
/* Avoid the strerror_r() prototype brain damage in glibc */
errno = error;
fprintf (stderr, " Error message: %m\n");
char buf[1000];
const char *msg;
switch (strerror_r (error, buf, sizeof (buf)))
case 0:
msg = buf;
case ERANGE: /* should never happen */
msg = "unknown (too big to display)";
msg = "unknown (invalid error number)";
fprintf (stderr, " Error message: %s\n", msg);
perror ("Thread error");
fflush (stderr);
vlc_restorecancel (canc);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment