summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/timer.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1997-10-23 20:11:01 +0000
committerache <ache@FreeBSD.org>1997-10-23 20:11:01 +0000
commit39156922f68cd1254c86a62bbfbed6bc9d87da70 (patch)
tree0c8eb1be14c90e69f82d093db5d38688ab2afe15 /usr.sbin/ppp/timer.c
parent26825b2fa5cabc92053279a931c2fb0bbcbde183 (diff)
downloadFreeBSD-src-39156922f68cd1254c86a62bbfbed6bc9d87da70.zip
FreeBSD-src-39156922f68cd1254c86a62bbfbed6bc9d87da70.tar.gz
Remove private sleep/usleep hacks
Diffstat (limited to 'usr.sbin/ppp/timer.c')
-rw-r--r--usr.sbin/ppp/timer.c64
1 files changed, 1 insertions, 63 deletions
diff --git a/usr.sbin/ppp/timer.c b/usr.sbin/ppp/timer.c
index 4790035..8454f69 100644
--- a/usr.sbin/ppp/timer.c
+++ b/usr.sbin/ppp/timer.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: timer.c,v 1.17 1997/06/09 03:27:40 brian Exp $
+ * $Id: timer.c,v 1.18 1997/08/25 00:29:30 brian Exp $
*
* TODO:
*/
@@ -197,68 +197,6 @@ ShowTimers()
}
#ifdef SIGALRM
-u_int
-sleep(u_int sec)
-{
- struct timeval to, st, et;
- long sld, nwd, std;
-
- gettimeofday(&st, NULL);
- to.tv_sec = sec;
- to.tv_usec = 0;
- std = st.tv_sec * 1000000 + st.tv_usec;
- for (;;) {
- if (select(0, NULL, NULL, NULL, &to) == 0 ||
- errno != EINTR) {
- break;
- } else {
- gettimeofday(&et, NULL);
- sld = to.tv_sec * 1000000 + to.tv_sec;
- nwd = et.tv_sec * 1000000 + et.tv_usec - std;
- if (sld > nwd)
- sld -= nwd;
- else
- sld = 1; /* Avoid both tv_sec/usec is 0 */
-
- /* Calculate timeout value for select */
- to.tv_sec = sld / 1000000;
- to.tv_usec = sld % 1000000;
- }
- }
- return (0L);
-}
-
-void
-usleep(u_int usec)
-{
- struct timeval to, st, et;
- long sld, nwd, std;
-
- gettimeofday(&st, NULL);
- to.tv_sec = 0;
- to.tv_usec = usec;
- std = st.tv_sec * 1000000 + st.tv_usec;
- for (;;) {
- if (select(0, NULL, NULL, NULL, &to) == 0 ||
- errno != EINTR) {
- break;
- } else {
- gettimeofday(&et, NULL);
- sld = to.tv_sec * 1000000 + to.tv_sec;
- nwd = et.tv_sec * 1000000 + et.tv_usec - std;
- if (sld > nwd)
- sld -= nwd;
- else
- sld = 1; /* Avoid both tv_sec/usec is 0 */
-
- /* Calculate timeout value for select */
- to.tv_sec = sld / 1000000;
- to.tv_usec = sld % 1000000;
-
- }
- }
-}
-
void
InitTimerService(void)
{
OpenPOWER on IntegriCloud