summaryrefslogtreecommitdiffstats
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 41f92cce..6ba9bd98 100644
--- a/openbsd-compat/bsd-misc.c
+++ b/openbsd-compat/bsd-misc.c
@@ -18,7 +18,7 @@
#include "includes.h"
#include "xmalloc.h"
-RCSID("$Id: bsd-misc.c,v 1.26 2005/02/25 23:07:38 dtucker Exp $");
+RCSID("$Id: bsd-misc.c,v 1.27 2005/05/27 11:13:41 dtucker Exp $");
#ifndef HAVE___PROGNAME
char *__progname;
@@ -212,3 +212,21 @@ mysignal(int sig, mysig_t act)
return (signal(sig, act));
#endif
}
+
+#ifndef HAVE_STRDUP
+char *
+strdup(const char *str)
+{
+ size_t len;
+ char *cp;
+
+ len = strlen(str) + 1;
+ cp = malloc(len);
+ if (cp != NULL)
+ if (strlcpy(cp, str, len) != len) {
+ free(cp);
+ return NULL;
+ }
+ return cp;
+}
+#endif