Skip to content

Commit

Permalink
[tests] clear errno to avoid incorrect propagation from void fn call
Browse files Browse the repository at this point in the history
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
  • Loading branch information
fabbione committed Sep 11, 2018
1 parent f5feda9 commit f10a83e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libknet/tests/test-common.c
Expand Up @@ -224,6 +224,10 @@ void flush_logs(int logfd, FILE *std)
int len = read(logfd, &msg + bytes_read,
sizeof(msg) - bytes_read);
if (len <= 0) {
/*
* clear errno to avoid incorrect propagation
*/
errno = 0;
return;
}
bytes_read += len;
Expand Down

0 comments on commit f10a83e

Please sign in to comment.