summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2013-03-15 10:34:25 +1100
committerDamien Miller <djm@mindrot.org>2013-03-15 10:34:25 +1100
commitf4db77d7668104c1237636781cfbd59ef30f79b0 (patch)
tree253b719c65b4ca1f94ea2da9e9ea1f249ce7fd66
parenta2438bbd28eb35a8968d193ac89b30a90e96f719 (diff)
- (djm) [configure.ac openbsd-compat/bsd-misc.c openbsd-compat/bsd-misc.h]
Add a usleep replacement for platforms that lack it; ok dtucker
-rw-r--r--ChangeLog2
-rw-r--r--configure.ac5
-rw-r--r--openbsd-compat/bsd-misc.c11
-rw-r--r--openbsd-compat/bsd-misc.h6
4 files changed, 21 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 635c4cd0c..9f6fc7058 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@
2 - (djm) [configure.ac] Disable utmp, wtmp and/or lastlog if the platform 2 - (djm) [configure.ac] Disable utmp, wtmp and/or lastlog if the platform
3 is unable to successfully compile them. Based on patch from des AT 3 is unable to successfully compile them. Based on patch from des AT
4 des.no 4 des.no
5 - (djm) [configure.ac openbsd-compat/bsd-misc.c openbsd-compat/bsd-misc.h]
6 Add a usleep replacement for platforms that lack it; ok dtucker
5 7
620120312 820120312
7 - (dtucker) [regress/Makefile regress/cipher-speed.sh regress/test-exec.sh] 9 - (dtucker) [regress/Makefile regress/cipher-speed.sh regress/test-exec.sh]
diff --git a/configure.ac b/configure.ac
index bf161b257..907192d60 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
1# $Id: configure.ac,v 1.515 2013/03/14 23:23:07 djm Exp $ 1# $Id: configure.ac,v 1.516 2013/03/14 23:34:25 djm Exp $
2# 2#
3# Copyright (c) 1999-2004 Damien Miller 3# Copyright (c) 1999-2004 Damien Miller
4# 4#
@@ -15,7 +15,7 @@
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 16
17AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) 17AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org])
18AC_REVISION($Revision: 1.515 $) 18AC_REVISION($Revision: 1.516 $)
19AC_CONFIG_SRCDIR([ssh.c]) 19AC_CONFIG_SRCDIR([ssh.c])
20AC_LANG([C]) 20AC_LANG([C])
21 21
@@ -1604,6 +1604,7 @@ AC_CHECK_FUNCS([ \
1604 unsetenv \ 1604 unsetenv \
1605 updwtmpx \ 1605 updwtmpx \
1606 user_from_uid \ 1606 user_from_uid \
1607 usleep \
1607 vasprintf \ 1608 vasprintf \
1608 vhangup \ 1609 vhangup \
1609 vsnprintf \ 1610 vsnprintf \
diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c
index 8dc7d02d1..d75854e83 100644
--- a/openbsd-compat/bsd-misc.c
+++ b/openbsd-compat/bsd-misc.c
@@ -165,6 +165,17 @@ int nanosleep(const struct timespec *req, struct timespec *rem)
165} 165}
166#endif 166#endif
167 167
168#if !defined(HAVE_USLEEP)
169int usleep(unsigned int useconds)
170{
171 struct timespec ts;
172
173 ts.tv_sec = useconds / 1000000;
174 ts.tv_nsec = (useconds % 1000000) * 1000;
175 return nanosleep(&ts, NULL);
176}
177#endif
178
168#ifndef HAVE_TCGETPGRP 179#ifndef HAVE_TCGETPGRP
169pid_t 180pid_t
170tcgetpgrp(int fd) 181tcgetpgrp(int fd)
diff --git a/openbsd-compat/bsd-misc.h b/openbsd-compat/bsd-misc.h
index de8367386..430066376 100644
--- a/openbsd-compat/bsd-misc.h
+++ b/openbsd-compat/bsd-misc.h
@@ -1,4 +1,4 @@
1/* $Id: bsd-misc.h,v 1.22 2013/02/15 00:41:36 dtucker Exp $ */ 1/* $Id: bsd-misc.h,v 1.23 2013/03/14 23:34:27 djm Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1999-2004 Damien Miller <djm@mindrot.org> 4 * Copyright (c) 1999-2004 Damien Miller <djm@mindrot.org>
@@ -80,6 +80,10 @@ struct timespec {
80int nanosleep(const struct timespec *, struct timespec *); 80int nanosleep(const struct timespec *, struct timespec *);
81#endif 81#endif
82 82
83#ifndef HAVE_USLEEP
84int usleep(unsigned int useconds);
85#endif
86
83#ifndef HAVE_TCGETPGRP 87#ifndef HAVE_TCGETPGRP
84pid_t tcgetpgrp(int); 88pid_t tcgetpgrp(int);
85#endif 89#endif