]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix casting in bwlimit
authorEric Bollengier <eric@eb.homelinux.org>
Sun, 28 Nov 2010 21:35:37 +0000 (22:35 +0100)
committerEric Bollengier <eric@eb.homelinux.org>
Wed, 1 Dec 2010 09:10:26 +0000 (10:10 +0100)
bacula/src/lib/bsock.c

index 22b4155ddcb874ca2d8623ae700ff9f528e09ed2..f9fa8fbccd5e280bf56dcdbc34a936ccc8700f0d 100644 (file)
@@ -1090,7 +1090,7 @@ void BSOCK::control_bwlimit(int bytes)
    }
 
    /* What exceed should be converted in sleep time */
-   int64_t usec_sleep = m_nb_bytes / (int64_t)((double)m_bwlimit / 1000000.0);
+   int64_t usec_sleep = (int64_t)(m_nb_bytes /((double)m_bwlimit / 1000000.0));
    if (usec_sleep > 100) {
       bmicrosleep(0, usec_sleep);
       m_last_tick = get_current_btime();