[vlc-commits] posix: simplify thread error handler
Rémi Denis-Courmont
git at videolan.org
Sun Dec 29 15:16:26 CET 2013
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Dec 29 15:35:35 2013 +0200| [c3bd77932a27694991d2d5481ffcf6227f998e84] | committer: Rémi Denis-Courmont
posix: simplify thread error handler
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c3bd77932a27694991d2d5481ffcf6227f998e84
---
src/posix/thread.c | 26 +-------------------------
1 file changed, 1 insertion(+), 25 deletions(-)
diff --git a/src/posix/thread.c b/src/posix/thread.c
index efa4953..07fa71e 100644
--- a/src/posix/thread.c
+++ b/src/posix/thread.c
@@ -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");
-#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
+ perror ("Thread error");
fflush (stderr);
vlc_restorecancel (canc);
More information about the vlc-commits
mailing list