]> granicus.if.org Git - check/commit
change check for valid clockid
authorbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Thu, 24 Oct 2013 02:14:55 +0000 (02:14 +0000)
committerbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Thu, 24 Oct 2013 02:14:55 +0000 (02:14 +0000)
commit7a4bfda9109ad9885329e116e9405f8af61ffed8
treef1168213e3a24f058721bef067e10ae591843ad4
parenta974ad48cdcc68cc5192c50820880e95ffee9ae5
change check for valid clockid

cygwin does not support CLOCK_MONOTONIC. However, a call to
clock_gettime(CLOCK_MONOTONIC, ...) will pass, whereas
a timer_create(CLOCK_MONOTONIC, ...) will fail. Use the
timer_create() call for the check instead.

However, be careful to only make the check if librt is available,
otherwise it is a waste. Or worse, if librt and alarm() are
unavailable, a timer_delete() will result in an assert(0).

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@847 64e312b2-a51f-0410-8e61-82d0ca0eb02a
src/check.c