Skip to content

Commit 9f2f11c

Browse files
committed
record_accesor: fix return value for flb_ra_get_kv_pair when get_ra_parser fails.
Signed-off-by: Phillip Adair Stewart Whelan <phillip.whelan@chronosphere.io>
1 parent cfc9ba9 commit 9f2f11c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/flb_record_accessor.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -755,8 +755,8 @@ static struct flb_ra_parser* get_ra_parser(struct flb_record_accessor *ra)
755755
* If 'record accessor' pattern matches an entry in the 'map', set the
756756
* reference in 'out_key' and 'out_val' for the entries in question.
757757
*
758-
* Returns FLB_TRUE if the pattern matched a kv pair, otherwise it returns
759-
* FLB_FALSE.
758+
* Returns 0 if the pattern matched a kv pair, otherwise it returns
759+
* -1.
760760
*/
761761
int flb_ra_get_kv_pair(struct flb_record_accessor *ra, msgpack_object map,
762762
msgpack_object **start_key,
@@ -766,7 +766,7 @@ int flb_ra_get_kv_pair(struct flb_record_accessor *ra, msgpack_object map,
766766

767767
rp = get_ra_parser(ra);
768768
if (rp == NULL) {
769-
return FLB_FALSE;
769+
return -1;
770770
}
771771

772772
return flb_ra_key_value_get(rp->key->name, map, rp->key->subkeys,

0 commit comments

Comments
 (0)