diff options
author | Jean-Baptiste Maillet <jean-baptiste.maillet@parrot.com> | 2014-11-24 11:40:59 +0100 |
---|---|---|
committer | Jean-Baptiste Maillet <jean-baptiste.maillet@parrot.com> | 2014-11-24 11:40:59 +0100 |
commit | 8390342495060071fbbc48e982636f2c6c91ca43 (patch) | |
tree | a4098972c7be7ad7c2cadb1b81f06ada5d91c20f /examples/simple_talker | |
parent | 1a355edac510a09e58172895025304ccbaa74aa3 (diff) | |
download | Open-AVB-8390342495060071fbbc48e982636f2c6c91ca43.tar.gz |
Fix for Coverity CID71725 - Unchecked return value from library
Diffstat (limited to 'examples/simple_talker')
-rwxr-xr-x | examples/simple_talker/simple_talker.c | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/examples/simple_talker/simple_talker.c b/examples/simple_talker/simple_talker.c index 90d9acf7..8162cc5a 100755 --- a/examples/simple_talker/simple_talker.c +++ b/examples/simple_talker/simple_talker.c @@ -767,25 +767,34 @@ int main(int argc, char *argv[]) } /* - * subtract 16 bytes for the MAC header/Q-tag - pktsz is limited to the - * data payload of the ethernet frame . + * subtract 16 bytes for the MAC header/Q-tag - pktsz is limited to the + * data payload of the ethernet frame. * - * IPG is scaled to the Class (A) observation interval of packets per 125 usec + * IPG is scaled to the Class (A) observation interval of packets per 125 usec. */ fprintf(stderr, "advertising stream ...\n"); if( transport == 2 ) { - mrp_advertise_stream - (STREAM_ID, dest_addr, domain_class_a_vid, PKT_SZ - 16, L2_PACKET_IPG / 125000, - domain_class_a_priority, 3900); + err = mrp_advertise_stream(STREAM_ID, dest_addr, + domain_class_a_vid, PKT_SZ - 16, + L2_PACKET_IPG / 125000, + domain_class_a_priority, 3900); } else { - /* 1 is the wrong number for frame rate, but fractional values not - allowed, not sure the significance of the value 6, but using it - consistently */ - mrp_advertise_stream - (STREAM_ID, dest_addr, domain_class_a_vid, - sizeof(*l4_headers)+L4_SAMPLES_PER_FRAME*CHANNELS*2 + 6, 1, - domain_class_a_priority, 3900); + /* + * 1 is the wrong number for frame rate, but fractional values + * not allowed, not sure the significance of the value 6, but + * using it consistently + */ + err = mrp_advertise_stream(STREAM_ID, dest_addr, + domain_class_a_vid, + sizeof(*l4_headers) + L4_SAMPLES_PER_FRAME * CHANNELS * 2 + 6, + 1, + domain_class_a_priority, 3900); } + if (err) { + printf("mrp_advertise_stream failed\n"); + return -1; + } + fprintf(stderr, "awaiting a listener ...\n"); mrp_await_listener(STREAM_ID); listeners = 1; |