randomconfig fixes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2011-08-10 10:45:48 +02:00
parent b47b3ce1bd
commit 47b03368f3
2 changed files with 13 additions and 21 deletions

View File

@@ -1,21 +1,13 @@
dt1="`date -R`"
# Wait for the start of next second
dt="$dt1"
while test x"$dt" = x"$dt1"; do
dt="`date -R`"
done
# When different date's use time() and clock_gettime(),
# seconds transition may not happen at _exactly_ the same moment.
# Therefore we try it several times.
bdt=`busybox date -R`
bdt=`busybox date -R`
bdt=`busybox date -R`
bdt=`busybox date -R`
bdt=`busybox date -R`
# Wtih !FEATURE_DATE_NANO, that is, with time()
# instead of clock_gettime(), seconds transition
# may not happen at _exactly_ the same moment,
# but can be delayed. Several busybox date -R
# invocations above are meant to deal with this.
# (two were enough for me, but I added more just in case).
test x"$dt" = x"$bdt"
test x"`date -R`" = x"`busybox date -R`" && exit 0 || true
test x"`date -R`" = x"`busybox date -R`" && exit 0 || true
test x"`date -R`" = x"`busybox date -R`" && exit 0 || true
test x"`date -R`" = x"`busybox date -R`" && exit 0 || true
test x"`date -R`" = x"`busybox date -R`" && exit 0 || true
test x"`date -R`" = x"`busybox date -R`" && exit 0 || true
test x"`date -R`" = x"`busybox date -R`" && exit 0 || true
test x"`date -R`" = x"`busybox date -R`" && exit 0 || true
false