diff options
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | openbsd-compat/bsd-misc.c | 10 | ||||
-rw-r--r-- | openbsd-compat/bsd-misc.h | 4 |
3 files changed, 15 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index b9f2a16cc..545bee88e 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -1770,6 +1770,7 @@ AC_CHECK_FUNCS([ \ | |||
1770 | strnlen \ | 1770 | strnlen \ |
1771 | strnvis \ | 1771 | strnvis \ |
1772 | strptime \ | 1772 | strptime \ |
1773 | strsignal \ | ||
1773 | strtonum \ | 1774 | strtonum \ |
1774 | strtoll \ | 1775 | strtoll \ |
1775 | strtoul \ | 1776 | strtoul \ |
diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c index cfd73260a..29f6ad38c 100644 --- a/openbsd-compat/bsd-misc.c +++ b/openbsd-compat/bsd-misc.c | |||
@@ -104,6 +104,16 @@ const char *strerror(int e) | |||
104 | } | 104 | } |
105 | #endif | 105 | #endif |
106 | 106 | ||
107 | #if !defined(HAVE_STRSIGNAL) | ||
108 | char *strsignal(int sig) | ||
109 | { | ||
110 | static char buf[16]; | ||
111 | |||
112 | (void)snprintf(buf, sizeof(buf), "%d", sig); | ||
113 | return buf; | ||
114 | } | ||
115 | #endif | ||
116 | |||
107 | #ifndef HAVE_UTIMES | 117 | #ifndef HAVE_UTIMES |
108 | int utimes(char *filename, struct timeval *tvp) | 118 | int utimes(char *filename, struct timeval *tvp) |
109 | { | 119 | { |
diff --git a/openbsd-compat/bsd-misc.h b/openbsd-compat/bsd-misc.h index 70a538f04..0b1a3504f 100644 --- a/openbsd-compat/bsd-misc.h +++ b/openbsd-compat/bsd-misc.h | |||
@@ -49,6 +49,10 @@ int setegid(uid_t); | |||
49 | const char *strerror(int); | 49 | const char *strerror(int); |
50 | #endif | 50 | #endif |
51 | 51 | ||
52 | #if !defined(HAVE_STRSIGNAL) | ||
53 | char *strsignal(int); | ||
54 | #endif | ||
55 | |||
52 | #if !defined(HAVE_SETLINEBUF) | 56 | #if !defined(HAVE_SETLINEBUF) |
53 | #define setlinebuf(a) (setvbuf((a), NULL, _IOLBF, 0)) | 57 | #define setlinebuf(a) (setvbuf((a), NULL, _IOLBF, 0)) |
54 | #endif | 58 | #endif |