[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>
This commit is contained in:
Bill Parker 2015-08-21 15:24:41 +02:00 committed by Anders Broman
parent d32c3dab46
commit 95c8b01753
1 changed files with 4 additions and 1 deletions

View File

@ -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;