From: ticktock35 Date: Mon, 15 Dec 2008 04:19:03 +0000 (+0000) Subject: opkg: don't report the same download percentage multiple times X-Git-Url: https://git.librecmc.org/?p=oweals%2Fopkg-lede.git;a=commitdiff_plain;h=1f047463e6714515aa100d881cbd49d8114e8c6f opkg: don't report the same download percentage multiple times git-svn-id: http://opkg.googlecode.com/svn/trunk@14 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358 --- diff --git a/opkg_download.c b/opkg_download.c index 3370b1f..fcc5294 100644 --- a/opkg_download.c +++ b/opkg_download.c @@ -46,6 +46,14 @@ curl_progress_func (char* url, #ifdef OPKG_LIB if (opkg_cb_download_progress) { + static int prev = -1; + + /* don't report the same percentage multiple times + * (this can occur due to rounding) */ + if (prev == p) + return 0; + prev = p; + opkg_cb_download_progress (p, url); return 0; }