diff options
author | Bill Parker <wp02855@gmail.com> | 2015-08-21 15:24:41 +0200 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2015-08-21 18:42:48 +0000 |
commit | 95c8b0175322260959d218c991186fc4a1cd7634 (patch) | |
tree | 407f892d8703c4619e9429013667e80dc379cee3 /echld | |
parent | d32c3dab46266aa94eb81c6a41f2dfb9cbf35a0e (diff) |
[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 <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'echld')
-rw-r--r-- | echld/common.c | 5 |
1 files changed, 4 insertions, 1 deletions
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; |