tls: Use ERR_get_error() in do_tls_poll

Message ID 1320658004-2232-1-git-send-email-martin@martin.st
State Committed
Commit f38f3b88a5a74d0573dc299a512a87f6d579323b
Headers show

Commit Message

Martin Storsjö Nov. 7, 2011, 9:26 a.m.
The return value ret isn't an error code that can be passed
to ERR_error_string().

This makes the error messages printed actually contain useful
information.
---
 libavformat/tls.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Luca Barbato Nov. 8, 2011, 8:45 p.m. | #1
On 11/7/11 1:26 AM, Martin Storsjö wrote:
> The return value ret isn't an error code that can be passed
> to ERR_error_string().
>

Ok

Patch

diff --git a/libavformat/tls.c b/libavformat/tls.c
index 85bf46f..bd73feb 100644
--- a/libavformat/tls.c
+++ b/libavformat/tls.c
@@ -87,7 +87,7 @@  static int do_tls_poll(URLContext *h, int ret)
     } else if (ret == SSL_ERROR_WANT_WRITE) {
         p.events = POLLOUT;
     } else {
-        av_log(NULL, AV_LOG_ERROR, "%s\n", ERR_error_string(ret, NULL));
+        av_log(NULL, AV_LOG_ERROR, "%s\n", ERR_error_string(ERR_get_error(), NULL));
         return AVERROR(EIO);
     }
 #endif