diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-12-12 15:27:13 +0100 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-12-12 15:27:13 +0100 |
commit | d2dc73cab5b1c08822ce0066251e362f01525f10 (patch) | |
tree | 7ee30f3670a1df1d2acd0b84e64e8f3fdf7b47a3 /tools.c | |
parent | d1a0a2e0322e6c5b05ba7817c1c0405dc20e5414 (diff) | |
download | pcitool-d2dc73cab5b1c08822ce0066251e362f01525f10.tar.gz pcitool-d2dc73cab5b1c08822ce0066251e362f01525f10.tar.bz2 pcitool-d2dc73cab5b1c08822ce0066251e362f01525f10.tar.xz pcitool-d2dc73cab5b1c08822ce0066251e362f01525f10.zip |
Minor fixes and improvements
Diffstat (limited to 'tools.c')
-rw-r--r-- | tools.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -332,9 +332,11 @@ int pcilib_sleep_until_deadline(struct timeval *tv) { pcilib_timeout_t duration; duration = pcilib_calc_time_to_deadline(tv); - wait.tv_sec = duration / 1000000; - wait.tv_nsec = 1000 * (duration % 1000000); - nanosleep(&wait, NULL); + if (duration > 0) { + wait.tv_sec = duration / 1000000; + wait.tv_nsec = 1000 * (duration % 1000000); + nanosleep(&wait, NULL); + } return 0; } |