summaryrefslogtreecommitdiff
path: root/openbsd-compat/bsd-misc.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2005-05-27 21:13:40 +1000
committerDarren Tucker <dtucker@zip.com.au>2005-05-27 21:13:40 +1000
commit2be1cbb7be25d32bc5741c96cc4d6951bd91fc30 (patch)
tree576901c63af5bc125eafd90698dcf41a20a89f48 /openbsd-compat/bsd-misc.c
parent287b4591945c27b374f810f44053b33206fb5eec (diff)
- (dtucker) [acconfig.h configure.ac defines.h includes.h sshpty.c
openbsd-compat/bsd-misc.c] Add support for Ultrix. No, that's not a typo. Required changes from Bernhard Simon, integrated by me. ok djm@
Diffstat (limited to 'openbsd-compat/bsd-misc.c')
-rw-r--r--openbsd-compat/bsd-misc.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c
index 41f92cce9..6ba9bd986 100644
--- a/openbsd-compat/bsd-misc.c
+++ b/openbsd-compat/bsd-misc.c
@@ -18,7 +18,7 @@
18#include "includes.h" 18#include "includes.h"
19#include "xmalloc.h" 19#include "xmalloc.h"
20 20
21RCSID("$Id: bsd-misc.c,v 1.26 2005/02/25 23:07:38 dtucker Exp $"); 21RCSID("$Id: bsd-misc.c,v 1.27 2005/05/27 11:13:41 dtucker Exp $");
22 22
23#ifndef HAVE___PROGNAME 23#ifndef HAVE___PROGNAME
24char *__progname; 24char *__progname;
@@ -212,3 +212,21 @@ mysignal(int sig, mysig_t act)
212 return (signal(sig, act)); 212 return (signal(sig, act));
213#endif 213#endif
214} 214}
215
216#ifndef HAVE_STRDUP
217char *
218strdup(const char *str)
219{
220 size_t len;
221 char *cp;
222
223 len = strlen(str) + 1;
224 cp = malloc(len);
225 if (cp != NULL)
226 if (strlcpy(cp, str, len) != len) {
227 free(cp);
228 return NULL;
229 }
230 return cp;
231}
232#endif