1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-30 17:18:21 +03:00

report: adjust shared flags based on expected type for reserved values

Generic numbers and time values share some operators so make sure
we have the flags correctly adjusted based on expected type if
we're using reserved values.
This commit is contained in:
Peter Rajnoha 2015-07-02 16:05:25 +02:00
parent eaa0d927a4
commit a32d5a4afc

View File

@ -2962,6 +2962,14 @@ static const char *_tok_value(struct dm_report *rh,
s = _get_reserved(rh, expected_type, field_num, implicit, s, begin, end, rvw);
if (rvw->reserved) {
/*
* FLD_CMP_NUMBER shares operators with FLD_CMP_TIME,
* so adjust flags here based on expected type.
*/
if (expected_type == DM_REPORT_FIELD_TYPE_TIME)
*flags &= ~FLD_CMP_NUMBER;
else if (expected_type == DM_REPORT_FIELD_TYPE_NUMBER)
*flags &= ~FLD_CMP_TIME;
*flags |= expected_type;
return s;
}