libfile: Make failure path of open_and_lseek() consistent
Change the code of open_and_lseek() to make sure that opened file is
closed in every failure path as well. While at it make sure we don't
mix returning function return code and returning errno by opting to
always return the former.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent 369d39a commit 05374a6eded63894263a27886ef19056362967be
@Andrey Smirnov Andrey Smirnov authored on 7 Mar 2019
Sascha Hauer committed on 11 Mar 2019
Showing 1 changed file
View
lib/libfile.c