]> andersk Git - openssh.git/blobdiff - openbsd-compat/bsd-misc.c
- stevesk@cvs.openbsd.org 2006/07/23 01:11:05
[openssh.git] / openbsd-compat / bsd-misc.c
index 23e66b1ccd71c730d23d2afaa399dba6cab7dcaa..d2d9ad77171009238de390bb591d78469150f2d2 100644 (file)
@@ -1,3 +1,4 @@
+
 /*
  * Copyright (c) 1999-2004 Damien Miller <djm@mindrot.org>
  *
  */
 
 #include "includes.h"
-#include "xmalloc.h"
 
-RCSID("$Id$");
+#include <signal.h>
 
-#ifndef HAVE__PROGNAME
+#include "xmalloc.h"
+
+#ifndef HAVE___PROGNAME
 char *__progname;
 #endif
 
@@ -121,17 +123,6 @@ int truncate(const char *path, off_t length)
 }
 #endif /* HAVE_TRUNCATE */
 
-#if !defined(HAVE_SETGROUPS) && defined(SETGROUPS_NOOP)
-/*
- * Cygwin setgroups should be a noop.
- */
-int
-setgroups(size_t size, const gid_t *list)
-{
-       return (0);
-}
-#endif 
-
 #if !defined(HAVE_NANOSLEEP) && !defined(HAVE_NSLEEP)
 int nanosleep(const struct timespec *req, struct timespec *rem)
 {
@@ -196,22 +187,6 @@ tcsendbreak(int fd, int duration)
 }
 #endif /* HAVE_TCSENDBREAK */
 
-#ifndef HAVE_CLOSEFROM
-int
-closefrom(int fd)
-{
-       int i, result = 0, err = 0;
-
-       for (i = fd; i < 128; i++)
-               if (close(i) != 0) {
-                       err = errno;
-                       result = -1;
-               }
-       errno = err;
-       return result;
-}
-#endif /* HAVE_CLOSEFROM */
-
 mysig_t
 mysignal(int sig, mysig_t act)
 {
@@ -238,3 +213,18 @@ 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)
+               return(memcpy(cp, str, len));
+       return NULL;
+}
+#endif
This page took 0.034252 seconds and 4 git commands to generate.