]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
Add minimal strsignal for platforms without it.
authorDarren Tucker <dtucker@zip.com.au>
Sun, 24 Sep 2017 23:48:10 +0000 (09:48 +1000)
committerDarren Tucker <dtucker@zip.com.au>
Sun, 24 Sep 2017 23:48:10 +0000 (09:48 +1000)
configure.ac
openbsd-compat/bsd-misc.c
openbsd-compat/bsd-misc.h

index b9f2a16cc658f4225120bab58e79b7d1971f77fa..545bee88e28c18f184dd2c3a4e77be93685d06ab 100644 (file)
@@ -1770,6 +1770,7 @@ AC_CHECK_FUNCS([ \
        strnlen \
        strnvis \
        strptime \
+       strsignal \
        strtonum \
        strtoll \
        strtoul \
index cfd73260ae1870f2b83c39cf367c2ce480cf71bf..29f6ad38c5a1aba62d6f8650669f331565fff6a3 100644 (file)
@@ -104,6 +104,16 @@ const char *strerror(int e)
 }
 #endif
 
+#if !defined(HAVE_STRSIGNAL)
+char *strsignal(int sig)
+{
+       static char buf[16];
+
+       (void)snprintf(buf, sizeof(buf), "%d", sig);
+       return buf;
+}
+#endif
+
 #ifndef HAVE_UTIMES
 int utimes(char *filename, struct timeval *tvp)
 {
index 70a538f04e2d62fa0c4d40d19417aeb79776cc79..0b1a3504f2cc643162fd58db6119ec536c2d1409 100644 (file)
@@ -49,6 +49,10 @@ int setegid(uid_t);
 const char *strerror(int);
 #endif
 
+#if !defined(HAVE_STRSIGNAL)
+char *strsignal(int);
+#endif
+
 #if !defined(HAVE_SETLINEBUF)
 #define setlinebuf(a)  (setvbuf((a), NULL, _IOLBF, 0))
 #endif