From 95c8b0175322260959d218c991186fc4a1cd7634 Mon Sep 17 00:00:00 2001 From: Bill Parker Date: Fri, 21 Aug 2015 15:24:41 +0200 Subject: [echld common] Call to fcntl() missing a test for a return value < 0, indicating failure. Bug: 11056 Change-Id: I87aef31d874224f38226df1725cc29d13ad16b54 Reviewed-on: https://code.wireshark.org/review/10182 Petri-Dish: Anders Broman Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- echld/common.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'echld/common.c') diff --git a/echld/common.c b/echld/common.c index c298d2c49c..564a48e29e 100644 --- a/echld/common.c +++ b/echld/common.c @@ -187,7 +187,10 @@ static void parent_realloc_buff(echld_reader_t* b, size_t needed) { void echld_reset_reader(echld_reader_t* r, int fd, size_t initial) { r->fd = fd; - fcntl(fd, F_SETFL, O_NONBLOCK); + if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0) { + fprintf(stderr, "Unable to set non blocking on file...\n"); + return; + } if (r->data == NULL) { r->actual_len = initial; -- cgit v1.2.3