From b74eb112c70671e71bd9e40fc4d50ef28ed80dd8 Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Sun, 17 Nov 2024 17:14:39 +0000 Subject: [PATCH] ksh: sleep inf: simplify (re: dd1dc47c) This can be done much more simply using a pause(3) call. --- src/cmd/ksh93/bltins/sleep.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/cmd/ksh93/bltins/sleep.c b/src/cmd/ksh93/bltins/sleep.c index 0f240822bee9..da86e3fc3b5d 100644 --- a/src/cmd/ksh93/bltins/sleep.c +++ b/src/cmd/ksh93/bltins/sleep.c @@ -148,11 +148,12 @@ void sh_delay(double t, int sflag) #if _lib_isinf if (isinf(t)) { - ts.tv_sec = 0xFFFFFFFF; /* uint32_t max */ - ts.tv_nsec = 0; while (1) - if (tvsleep(&ts, NULL) < 0 && ((sh.trapnote & (SH_SIGSET | SH_SIGTRAP)) || sflag)) + { + pause(); + if ((sh.trapnote & (SH_SIGSET | SH_SIGTRAP)) || sflag) return; + } } #endif /* _lib_isinf */ n = (uint32_t)t;