<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, Jan 3, 2015 at 1:07 PM, Rémi Denis-Courmont <span dir="ltr"><<a href="mailto:remi@remlab.net" target="_blank">remi@remlab.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Le 2015-01-03 21:02, Sean McGovern a écrit :<div><div class="h5"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Solaris libc does not implement strerror_l().<br>
---<br>
src/Makefile.am | 16 ++++++++++++++++<br>
src/solaris/error.c | 39 ++++++++++++++++++++++++++++++<u></u>+++++++++<br>
2 files changed, 55 insertions(+)<br>
create mode 100644 src/solaris/error.c<br>
<br>
diff --git a/src/Makefile.am b/src/Makefile.am<br>
index e200669..e884afe 100644<br>
--- a/src/Makefile.am<br>
+++ b/src/Makefile.am<br>
@@ -232,6 +232,9 @@ else<br>
if HAVE_OS2<br>
libvlccore_la_SOURCES += $(SOURCES_libvlc_os2)<br>
else<br>
+if HAVE_SOLARIS<br>
+libvlccore_la_SOURCES += $(SOURCES_libvlc_solaris)<br>
+else<br>
libvlccore_la_SOURCES += $(SOURCES_libvlc_other)<br>
endif<br>
endif<br>
@@ -239,6 +242,7 @@ endif<br>
endif<br>
endif<br>
endif<br>
+endif<br>
if BUILD_HTTPD<br>
libvlccore_la_SOURCES += $(SOURCES_libvlc_httpd)<br>
endif<br>
@@ -320,6 +324,18 @@ SOURCES_libvlc_os2 = \<br>
os2/rand.c \<br>
$(NULL)<br>
<br>
+SOURCES_libvlc_solaris = \<br>
+ posix/dirs.c \<br>
+ solaris/error.c \<br>
+ posix/filesystem.c \<br>
+ posix/netconf.c \<br>
+ posix/thread.c \<br>
+ posix/timer.c \<br>
+ posix/plugin.c \<br>
+ posix/specific.c \<br>
+ posix/rand.c \<br>
+ $(NULL)<br>
+<br>
SOURCES_libvlc_other = \<br>
posix/dirs.c \<br>
posix/error.c \<br>
diff --git a/src/solaris/error.c b/src/solaris/error.c<br>
new file mode 100644<br>
index 0000000..b7e4faa<br>
--- /dev/null<br>
+++ b/src/solaris/error.c<br>
@@ -0,0 +1,39 @@<br>
<br>
+/****************************<u></u>******************************<u></u>*******************<br>
+ * error.c: POSIX error messages formatting<br>
+<br>
<br>
******************************<u></u>******************************<u></u>*****************<br>
+ * This program is free software; you can redistribute it and/or modify it<br>
+ * under the terms of the GNU Lesser General Public License as published by<br>
+ * the Free Software Foundation; either version 2.1 of the License, or<br>
+ * (at your option) any later version.<br>
+ *<br>
+ * This program is distributed in the hope that it will be useful,<br>
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br>
+ * GNU Lesser General Public License for more details.<br>
+ *<br>
+ * You should have received a copy of the GNU Lesser General Public License<br>
+ * along with this program; if not, write to the Free Software Foundation,<br>
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.<br>
+<br>
<br>
******************************<u></u>******************************<u></u>*****************/<br>
+<br>
+#ifdef HAVE_CONFIG_H<br>
+# include "config.h"<br>
+#endif<br>
+<br>
+#include <errno.h><br>
+<br>
+#include <vlc_common.h><br>
+<br>
+<br>
+const char* vlc_strerror(int errnum)<br>
+{<br>
+ return vlc_strerror_c(errnum);<br>
+}<br>
+<br>
+const char* vlc_strerror_c(int errnum)<br>
+{<br>
+ static char message_buf[100];<br>
</blockquote>
<br></div></div>
That's not thread-safe.<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ strerror_r(errnum, message_buf, 100);<br>
+ return message_buf;<br>
</blockquote>
<br></span>
Even aside from thread safety, that will return uninitialized memory if strerror_r fails.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+}<br>
+<span class="HOEnZb"><font color="#888888"><br>
</font></span></blockquote><span class="HOEnZb"><font color="#888888">
<br>
-- <br>
Rémi Denis-Courmont</font></span><br></blockquote><div><br></div><div>Oh -- OK I guess I still have some work to do. Thanks for pointing that out.<br><br></div><div>-- Sean McG. <br></div></div></div></div>