From 6aed80b4f7a1e8e02ba97c13018402f014c69ff5 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Tue, 28 Aug 2018 15:38:11 -0400 Subject: [PATCH] freebsd11_network: Implement pause() using snooze() instead of cvars. This is much simpler than the prior condvar-based method and should be functionally equivalent. It seems tsleep() cause a NULL dereference, though (which will be fixed in the next commit), so this probably also fixes #14355. Change-Id: I36968de38ceb0a1c0896cae8839821f5ca383504 Reviewed-on: https://review.haiku-os.org/489 Reviewed-by: waddlesplash --- src/libs/compat/freebsd11_network/synch.c | 9 --------- src/libs/compat/freebsd11_network/systm.c | 9 +++++++++ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/libs/compat/freebsd11_network/synch.c b/src/libs/compat/freebsd11_network/synch.c index 8f872636ba..d5eff17e82 100644 --- a/src/libs/compat/freebsd11_network/synch.c +++ b/src/libs/compat/freebsd11_network/synch.c @@ -36,12 +36,3 @@ wakeup(void* identifier) { publishedConditionNotifyAll(identifier); } - - -int -_pause(const char* waitMessage, int timeout) -{ - int waitChannel; - KASSERT(timeout != 0, ("pause: timeout required")); - return tsleep(&waitChannel, 0, waitMessage, timeout); -} diff --git a/src/libs/compat/freebsd11_network/systm.c b/src/libs/compat/freebsd11_network/systm.c index f1c9df31fb..84d90740be 100644 --- a/src/libs/compat/freebsd11_network/systm.c +++ b/src/libs/compat/freebsd11_network/systm.c @@ -5,6 +5,15 @@ #include +#include + + +int +_pause(const char* waitMessage, int timeout) +{ + KASSERT(timeout != 0, ("pause: timeout required")); + return snooze(ticks_to_usecs(timeout)); +} void