Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PPSi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
50
Issues
50
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
PPSi
Commits
f613b296
Commit
f613b296
authored
Mar 08, 2013
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bmc: use new diagnostic code
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
5ea9476b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
bmc.c
proto-standard/bmc.c
+11
-6
No files found.
proto-standard/bmc.c
View file @
f613b296
...
...
@@ -110,7 +110,8 @@ static int bmc_dataset_cmp(struct pp_instance *ppi,
struct
ClockIdentity
*
idparent
;
int
diff
;
PP_VPRINTF
(
"BMC: in bmc_dataset_cmp
\n
"
);
/* dataset_cmp is called several times, so report only at level 2 */
pp_diag
(
ppi
,
bmc
,
2
,
"%s
\n
"
,
__func__
);
if
(
!
idcmp
(
&
aa
->
grandmasterIdentity
,
&
ab
->
grandmasterIdentity
))
{
...
...
@@ -124,7 +125,8 @@ static int bmc_dataset_cmp(struct pp_instance *ppi,
if
(
diff
>
0
)
{
if
(
!
idcmp
(
ida
,
idparent
))
{
PP_PRINTF
(
"Sender=Receiver: Error -1"
);
pp_diag
(
ppi
,
bmc
,
1
,
"%s:%i: Error 1
\n
"
,
__func__
,
__LINE__
);
return
0
;
}
return
1
;
...
...
@@ -132,7 +134,8 @@ static int bmc_dataset_cmp(struct pp_instance *ppi,
}
if
(
diff
<
0
)
{
if
(
!
idcmp
(
idb
,
idparent
))
{
PP_PRINTF
(
"Sender=Receiver: Error -3"
);
pp_diag
(
ppi
,
bmc
,
1
,
"%s:%i: Error 1
\n
"
,
__func__
,
__LINE__
);
return
0
;
}
return
-
1
;
...
...
@@ -140,7 +143,7 @@ static int bmc_dataset_cmp(struct pp_instance *ppi,
/* stepsRemoved is equal, compare identities */
diff
=
idcmp
(
ida
,
idb
);
if
(
!
diff
)
{
PP_PRINTF
(
"Sender=Receiver: Error -2"
);
pp_diag
(
ppi
,
bmc
,
1
,
"%s:%i: Error 2
\n
"
,
__func__
,
__LINE__
);
return
0
;
}
return
diff
;
...
...
@@ -202,7 +205,7 @@ static int bmc_state_decision(struct pp_instance *ppi, struct pp_frgn_master *m)
if
(
cmpres
>
0
)
goto
slave
;
PP_PRINTF
(
"Error in bmc_state_decision, cmpres=0.
\n
"
);
pp_diag
(
ppi
,
bmc
,
1
,
"%s: error
\n
"
,
__func__
);
/* MB: Is this the return code below correct? */
/* Anyway, it's a valid return code. */
...
...
@@ -210,10 +213,12 @@ static int bmc_state_decision(struct pp_instance *ppi, struct pp_frgn_master *m)
master:
m1
(
ppi
);
pp_diag
(
ppi
,
bmc
,
1
,
"%s: master
\n
"
,
__func__
);
return
PPS_MASTER
;
slave:
s1
(
ppi
,
&
m
->
hdr
,
&
m
->
ann
);
pp_diag
(
ppi
,
bmc
,
1
,
"%s: slave
\n
"
,
__func__
);
return
PPS_SLAVE
;
}
...
...
@@ -234,7 +239,7 @@ int bmc(struct pp_instance *ppi)
<
0
)
best
=
i
;
PP_VPRINTF
(
"bmc, best record : %d
\n
"
,
best
);
pp_diag
(
ppi
,
bmc
,
1
,
"Best foreign master is %i
\n
"
,
best
);
ppi
->
foreign_record_best
=
best
;
return
bmc_state_decision
(
ppi
,
&
frgn_master
[
best
]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment