From 860d6bdbe794cd17af2f38843483442c60078762 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 15 Feb 2015 19:54:37 +0100 Subject: [PATCH] libspark/dmx: try to fix mysterious crash with gcc4.9 --- libspark/dmx.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libspark/dmx.cpp b/libspark/dmx.cpp index 1f512d1..56195d9 100644 --- a/libspark/dmx.cpp +++ b/libspark/dmx.cpp @@ -4,7 +4,7 @@ * * derived from libtriple/dmx_td.cpp * - * (C) 2010-2013 Stefan Seyfried + * (C) 2010-2013,2015 Stefan Seyfried * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -337,8 +337,9 @@ int cDemux::Read(unsigned char *buff, int len, int timeout) rc = ::read(fd, buff, len); //fprintf(stderr, "fd %d ret: %d\n", fd, rc); + int saved_errno = errno; if (rc < 0) - dmx_err("read: %s", strerror(errno), 0); + dmx_err("read: %s", strerror(saved_errno), 0); return rc; }