build system: fix sorting + locale in make objsizes
[oweals/busybox.git] / libbb / perror_msg.c
index 2ec1a9b2acd3efeb05661897c0b51fbea67fe9ef..6c8e1b51ef8cfca1cf984f4301b2783644eb5141 100644 (file)
@@ -9,15 +9,17 @@
 
 #include "libbb.h"
 
-void bb_perror_msg(const char *s, ...)
+void FAST_FUNC bb_perror_msg(const char *s, ...)
 {
        va_list p;
 
        va_start(p, s);
        /* Guard against "<error message>: Success" */
-       if (!errno)
-               bb_verror_msg(s, p, NULL);
-       else
-               bb_vperror_msg(s, p);
+       bb_verror_msg(s, p, errno ? strerror(errno) : NULL);
        va_end(p);
 }
+
+void FAST_FUNC bb_simple_perror_msg(const char *s)
+{
+       bb_perror_msg("%s", s);
+}