[openssh-commits] [openssh] 01/01: Add minimal strsignal for platforms without it.

git+noreply at mindrot.org git+noreply at mindrot.org
Mon Sep 25 09:49:15 AEST 2017


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch master
in repository openssh.

commit 44fc334c7a9ebdd08addb6d5fa005369897fddeb
Author: Darren Tucker <dtucker at zip.com.au>
Date:   Mon Sep 25 09:48:10 2017 +1000

    Add minimal strsignal for platforms without it.
---
 configure.ac              |  1 +
 openbsd-compat/bsd-misc.c | 10 ++++++++++
 openbsd-compat/bsd-misc.h |  4 ++++
 3 files changed, 15 insertions(+)

diff --git a/configure.ac b/configure.ac
index b9f2a16c..545bee88 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1770,6 +1770,7 @@ AC_CHECK_FUNCS([ \
 	strnlen \
 	strnvis \
 	strptime \
+	strsignal \
 	strtonum \
 	strtoll \
 	strtoul \
diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c
index cfd73260..29f6ad38 100644
--- a/openbsd-compat/bsd-misc.c
+++ b/openbsd-compat/bsd-misc.c
@@ -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)
 {
diff --git a/openbsd-compat/bsd-misc.h b/openbsd-compat/bsd-misc.h
index 70a538f0..0b1a3504 100644
--- a/openbsd-compat/bsd-misc.h
+++ b/openbsd-compat/bsd-misc.h
@@ -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

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list