tests: Use usleep instead of nanosleep

Commit "Build tests by default" 68f406436c
changes the build so tests are always built.

On Solaris 10 the build fails because nanosleep is in librt, which we do
not link against.

Replace nanosleep with usleep.  This avoids introducing extra configure
tests just for Solaris 10.

Note that with Solaris 11 nanosleep was moved from librt to libc, the
standard C library.

Change-Id: I6639f32bb8c8ace438e0092a866f06561dad54f1
Reviewed-on: https://gerrit.openafs.org/14244
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
This commit is contained in:
Cheyenne Wills 2020-06-16 15:20:20 -06:00 committed by Benjamin Kaduk
parent 5f4a681eeb
commit 22a66e7b7e

View File

@ -379,7 +379,7 @@ waitforsig(int signo, int nsecs)
for (nsleeps = 0; nsleeps < nsecs * 10; nsleeps++) {
sigset_t set;
struct timespec timeo;
int code;
opr_Verify(sigpending(&set) == 0);
if (sigismember(&set, signo)) {
@ -387,9 +387,8 @@ waitforsig(int signo, int nsecs)
}
/* Sleep for 100ms */
timeo.tv_sec = 0;
timeo.tv_nsec = 100 * 1000 * 1000;
opr_Verify(nanosleep(&timeo, NULL) == 0);
code = usleep(100000);
opr_Assert(code == 0 || errno == EINTR);
}
return -1;