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, ...@@ -162,31 +162,7 @@ vlc_thread_fatal (const char *action, int error,
fprintf (stderr, "LibVLC fatal error %s (%d) in thread %lu ", fprintf (stderr, "LibVLC fatal error %s (%d) in thread %lu ",
action, error, vlc_threadid ()); action, error, vlc_threadid ());
vlc_trace (function, file, line); vlc_trace (function, file, line);
perror ("Thread error");
/* 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");
#else
char buf[1000];
const char *msg;
switch (strerror_r (error, buf, sizeof (buf)))
{
case 0:
msg = buf;
break;
case ERANGE: /* should never happen */
msg = "unknown (too big to display)";
break;
default:
msg = "unknown (invalid error number)";
break;
}
fprintf (stderr, " Error message: %s\n", msg);
#endif
fflush (stderr); fflush (stderr);
vlc_restorecancel (canc); 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