aboutsummaryrefslogtreecommitdiffstats
path: root/URPM.xs
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2006-03-13 14:44:53 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2006-03-13 14:44:53 +0000
commitfc8b6150860d0f55cd52c3534444315c9c46ea12 (patch)
tree7877df600ad771dc7b468db669e0fac755f53eb0 /URPM.xs
parent192dc8326d7dd4805c37529a13f4c6c78d695cee (diff)
downloadperl-URPM-fc8b6150860d0f55cd52c3534444315c9c46ea12.tar
perl-URPM-fc8b6150860d0f55cd52c3534444315c9c46ea12.tar.gz
perl-URPM-fc8b6150860d0f55cd52c3534444315c9c46ea12.tar.bz2
perl-URPM-fc8b6150860d0f55cd52c3534444315c9c46ea12.tar.xz
perl-URPM-fc8b6150860d0f55cd52c3534444315c9c46ea12.zip
Fix misplaced break in switch statement
Diffstat (limited to 'URPM.xs')
-rw-r--r--URPM.xs90
1 files changed, 47 insertions, 43 deletions
diff --git a/URPM.xs b/URPM.xs
index 0d8b155..dfe3c85 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -1275,56 +1275,60 @@ static void *rpmRunTransactions_callback(const void *h,
char *callback_subtype = NULL;
switch (what) {
- case RPMCALLBACK_INST_OPEN_FILE:
- callback = td->callback_open; callback_type = "open"; break;
-
- case RPMCALLBACK_INST_CLOSE_FILE:
- callback = td->callback_close; callback_type = "close"; break;
-
- case RPMCALLBACK_TRANS_START:
- case RPMCALLBACK_TRANS_PROGRESS:
- case RPMCALLBACK_TRANS_STOP:
- callback = td->callback_trans; callback_type = "trans"; break;
-
- case RPMCALLBACK_UNINST_START:
- case RPMCALLBACK_UNINST_PROGRESS:
- case RPMCALLBACK_UNINST_STOP:
- callback = td->callback_uninst; callback_type = "uninst"; break;
-
- case RPMCALLBACK_INST_START:
- case RPMCALLBACK_INST_PROGRESS:
- callback = td->callback_inst; callback_type = "inst"; break;
-
- default:
- break;
- }
-
- if (callback != NULL) {
- switch (what) {
+ case RPMCALLBACK_INST_OPEN_FILE:
+ callback = td->callback_open;
+ callback_type = "open";
+ break;
+ case RPMCALLBACK_INST_CLOSE_FILE:
+ callback = td->callback_close;
+ callback_type = "close";
+ break;
case RPMCALLBACK_TRANS_START:
- case RPMCALLBACK_UNINST_START:
- case RPMCALLBACK_INST_START:
- callback_subtype = "start"; break;
- gettimeofday(&tprev, NULL);
-
case RPMCALLBACK_TRANS_PROGRESS:
+ case RPMCALLBACK_TRANS_STOP:
+ callback = td->callback_trans;
+ callback_type = "trans";
+ break;
+ case RPMCALLBACK_UNINST_START:
case RPMCALLBACK_UNINST_PROGRESS:
+ case RPMCALLBACK_UNINST_STOP:
+ callback = td->callback_uninst;
+ callback_type = "uninst";
+ break;
+ case RPMCALLBACK_INST_START:
case RPMCALLBACK_INST_PROGRESS:
- callback_subtype = "progress";
- gettimeofday(&tcurr, NULL);
- delta = 1000000 * (tcurr.tv_sec - tprev.tv_sec) + (tcurr.tv_usec - tprev.tv_usec);
- if (delta < td->min_delta && amount < total - 1)
- callback = NULL; /* avoid calling too often a given callback */
- else
- tprev = tcurr;
+ callback = td->callback_inst;
+ callback_type = "inst";
break;
-
- case RPMCALLBACK_TRANS_STOP:
- case RPMCALLBACK_UNINST_STOP:
- callback_subtype = "stop"; break;
-
default:
break;
+ }
+
+ if (callback != NULL) {
+ switch (what) {
+ case RPMCALLBACK_TRANS_START:
+ case RPMCALLBACK_UNINST_START:
+ case RPMCALLBACK_INST_START:
+ callback_subtype = "start";
+ gettimeofday(&tprev, NULL);
+ break;
+ case RPMCALLBACK_TRANS_PROGRESS:
+ case RPMCALLBACK_UNINST_PROGRESS:
+ case RPMCALLBACK_INST_PROGRESS:
+ callback_subtype = "progress";
+ gettimeofday(&tcurr, NULL);
+ delta = 1000000 * (tcurr.tv_sec - tprev.tv_sec) + (tcurr.tv_usec - tprev.tv_usec);
+ if (delta < td->min_delta && amount < total - 1)
+ callback = NULL; /* avoid calling too often a given callback */
+ else
+ tprev = tcurr;
+ break;
+ case RPMCALLBACK_TRANS_STOP:
+ case RPMCALLBACK_UNINST_STOP:
+ callback_subtype = "stop";
+ break;
+ default:
+ break;
}
if (callback != NULL) {