aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/asshelp.c5
-rw-r--r--common/sysutils.c7
2 files changed, 7 insertions, 5 deletions
diff --git a/common/asshelp.c b/common/asshelp.c
index 542747af8..b9c0cf441 100644
--- a/common/asshelp.c
+++ b/common/asshelp.c
@@ -337,7 +337,10 @@ wait_for_sock (int secs, int which, const char *sockname,
{
if (verbose)
{
- secsleft = (target_us - elapsed_us)/1000000;
+ secsleft = (target_us - elapsed_us + 999999)/1000000;
+ /* log_clock ("left=%d last=%d targ=%d elap=%d next=%d\n", */
+ /* secsleft, lastalert, target_us, elapsed_us, */
+ /* next_sleep_us); */
if (secsleft < lastalert)
{
log_info (which == 1?
diff --git a/common/sysutils.c b/common/sysutils.c
index e90010c44..55a7ee9ec 100644
--- a/common/sysutils.c
+++ b/common/sysutils.c
@@ -340,11 +340,10 @@ gnupg_usleep (unsigned int usecs)
struct timespec req;
struct timespec rem;
- req.tv_sec = 0;
- req.tv_nsec = usecs * 1000;
-
+ req.tv_sec = usecs / 1000000;
+ req.tv_nsec = (usecs % 1000000) * 1000;
while (nanosleep (&req, &rem) < 0 && errno == EINTR)
- req = rem;
+ req = rem;
}
#else /*Standard Unix*/