summaryrefslogtreecommitdiff
path: root/openbsd-compat/bsd-misc.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@dtucker.net>2018-02-11 21:25:11 +1300
committerDarren Tucker <dtucker@dtucker.net>2018-02-11 21:24:48 +1100
commitfbfa6f980d7460b3e12b0ce88ed3b6018edf4711 (patch)
tree0c75a95f5f6e2a1e7d2de891f7b7476e41574f56 /openbsd-compat/bsd-misc.c
parent24d2a33bd3bf5170700bfdd8675498aa09a79eab (diff)
Move signal compat code into bsd-signal.{c,h}
Diffstat (limited to 'openbsd-compat/bsd-misc.c')
-rw-r--r--openbsd-compat/bsd-misc.c37
1 files changed, 0 insertions, 37 deletions
diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c
index 29f6ad38c..9f6dc8af2 100644
--- a/openbsd-compat/bsd-misc.c
+++ b/openbsd-compat/bsd-misc.c
@@ -104,16 +104,6 @@ const char *strerror(int e)
104} 104}
105#endif 105#endif
106 106
107#if !defined(HAVE_STRSIGNAL)
108char *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
117#ifndef HAVE_UTIMES 107#ifndef HAVE_UTIMES
118int utimes(char *filename, struct timeval *tvp) 108int utimes(char *filename, struct timeval *tvp)
119{ 109{
@@ -221,33 +211,6 @@ tcsendbreak(int fd, int duration)
221} 211}
222#endif /* HAVE_TCSENDBREAK */ 212#endif /* HAVE_TCSENDBREAK */
223 213
224mysig_t
225mysignal(int sig, mysig_t act)
226{
227#ifdef HAVE_SIGACTION
228 struct sigaction sa, osa;
229
230 if (sigaction(sig, NULL, &osa) == -1)
231 return (mysig_t) -1;
232 if (osa.sa_handler != act) {
233 memset(&sa, 0, sizeof(sa));
234 sigemptyset(&sa.sa_mask);
235 sa.sa_flags = 0;
236#ifdef SA_INTERRUPT
237 if (sig == SIGALRM)
238 sa.sa_flags |= SA_INTERRUPT;
239#endif
240 sa.sa_handler = act;
241 if (sigaction(sig, &sa, NULL) == -1)
242 return (mysig_t) -1;
243 }
244 return (osa.sa_handler);
245#else
246 #undef signal
247 return (signal(sig, act));
248#endif
249}
250
251#ifndef HAVE_STRDUP 214#ifndef HAVE_STRDUP
252char * 215char *
253strdup(const char *str) 216strdup(const char *str)