From a29967e27e72254d37abd1e3f8b919173ded0776 Mon Sep 17 00:00:00 2001 From: BakhtiyorBahriddini Date: Mon, 29 Jul 2024 21:30:28 +0300 Subject: [PATCH 1/2] Checking devision by zero --- src/lock/print.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lock/print.cpp b/src/lock/print.cpp index fcfc8215687..0f6ba974899 100644 --- a/src/lock/print.cpp +++ b/src/lock/print.cpp @@ -1004,7 +1004,7 @@ static void prt_lock_activity(OUTFILE outfile, FPRINTF(outfile, "%02d:%02d:%02d ", d.tm_hour, d.tm_min, d.tm_sec); - if (flag & SW_I_ACQUIRE) + if (flag & SW_I_ACQUIRE && seconds!=0 ) { FPRINTF(outfile, "%9" UQUADFORMAT" %9" UQUADFORMAT" %9" UQUADFORMAT " %9" UQUADFORMAT" %9" UQUADFORMAT" ", @@ -1024,7 +1024,7 @@ static void prt_lock_activity(OUTFILE outfile, prior.lhb_retry_success = LOCK_header->lhb_retry_success; } - if (flag & SW_I_OPERATION) + if (flag & SW_I_OPERATION && seconds!=0) { FPRINTF(outfile, "%9" UQUADFORMAT" %9" UQUADFORMAT" %9" UQUADFORMAT " %9" UQUADFORMAT" %9" UQUADFORMAT" %9" UQUADFORMAT @@ -1046,7 +1046,7 @@ static void prt_lock_activity(OUTFILE outfile, prior.lhb_query_data = LOCK_header->lhb_query_data; } - if (flag & SW_I_TYPE) + if ( flag & SW_I_TYPE && seconds!=0 ) { FPRINTF(outfile, "%9" UQUADFORMAT" %9" UQUADFORMAT" %9" UQUADFORMAT " %9" UQUADFORMAT" %9" UQUADFORMAT" %9" UQUADFORMAT @@ -1074,7 +1074,7 @@ static void prt_lock_activity(OUTFILE outfile, prior.lhb_operations[0] = LOCK_header->lhb_operations[0]; } - if (flag & SW_I_WAIT) + if ( flag & SW_I_WAIT && seconds!=0 ) { FPRINTF(outfile, "%9" UQUADFORMAT" %9" UQUADFORMAT" %9" UQUADFORMAT " %9" UQUADFORMAT" %9" UQUADFORMAT" %9" UQUADFORMAT From 5143be83a17185fb133ae648a3fb5e2d1fca65bf Mon Sep 17 00:00:00 2001 From: BakhtiyorBahriddini Date: Sun, 4 Aug 2024 20:49:31 +0300 Subject: [PATCH 2/2] Update print.cpp --- src/lock/print.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lock/print.cpp b/src/lock/print.cpp index 0f6ba974899..01984749514 100644 --- a/src/lock/print.cpp +++ b/src/lock/print.cpp @@ -1004,7 +1004,7 @@ static void prt_lock_activity(OUTFILE outfile, FPRINTF(outfile, "%02d:%02d:%02d ", d.tm_hour, d.tm_min, d.tm_sec); - if (flag & SW_I_ACQUIRE && seconds!=0 ) + if (flag & SW_I_ACQUIRE && seconds!=0) { FPRINTF(outfile, "%9" UQUADFORMAT" %9" UQUADFORMAT" %9" UQUADFORMAT " %9" UQUADFORMAT" %9" UQUADFORMAT" ", @@ -1046,7 +1046,7 @@ static void prt_lock_activity(OUTFILE outfile, prior.lhb_query_data = LOCK_header->lhb_query_data; } - if ( flag & SW_I_TYPE && seconds!=0 ) + if ( flag & SW_I_TYPE && seconds!=0) { FPRINTF(outfile, "%9" UQUADFORMAT" %9" UQUADFORMAT" %9" UQUADFORMAT " %9" UQUADFORMAT" %9" UQUADFORMAT" %9" UQUADFORMAT @@ -1074,7 +1074,7 @@ static void prt_lock_activity(OUTFILE outfile, prior.lhb_operations[0] = LOCK_header->lhb_operations[0]; } - if ( flag & SW_I_WAIT && seconds!=0 ) + if ( flag & SW_I_WAIT && seconds!=0) { FPRINTF(outfile, "%9" UQUADFORMAT" %9" UQUADFORMAT" %9" UQUADFORMAT " %9" UQUADFORMAT" %9" UQUADFORMAT" %9" UQUADFORMAT