From: Volker Lendecke Date: Thu, 22 Apr 2010 04:24:06 +0000 (+0930) Subject: tdb: Fix bug 7248, avoid the nanosleep dependency X-Git-Tag: ctdb-1.9.1~85^2~8 X-Git-Url: http://git.samba.org/?p=sahlberg%2Fctdb.git;a=commitdiff_plain;h=3318c74386e202b77ba7e29b4c3e0ce4d88fcd5b tdb: Fix bug 7248, avoid the nanosleep dependency (Imported from commit e2c7e5c4f72565fe49265d5b036531926ea1ac92) --- diff --git a/lib/tdb/tools/tdbtorture.c b/lib/tdb/tools/tdbtorture.c index 5ee69918..eda79f83 100644 --- a/lib/tdb/tools/tdbtorture.c +++ b/lib/tdb/tools/tdbtorture.c @@ -355,12 +355,12 @@ int main(int argc, char * const *argv) pid = waitpid(-1, &status, kill_random ? WNOHANG : 0); if (pid == 0) { - struct timespec ts; + struct timeval tv; /* Sleep for 1/10 second. */ - ts.tv_sec = 0; - ts.tv_nsec = 100000000; - nanosleep(&ts, NULL); + tv.tv_sec = 0; + tv.tv_usec = 100000; + select(0, NULL, NULL, NULL, &tv); /* Kill someone. */ kill(pids[random() % num_procs], SIGUSR1);