diff mbox series

swupdate_file_setnonblock: simply returns from fcntl

Message ID 20200115151009.4283-1-sbabic@denx.de
State Accepted
Headers show
Series swupdate_file_setnonblock: simply returns from fcntl | expand

Commit Message

Stefano Babic Jan. 15, 2020, 3:10 p.m. UTC
Fucntion returns the wrong status causing a warning during an update -
fix the return logic.

Signed-off-by: Stefano Babic <sbabic@denx.de>
---
 core/util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/core/util.c b/core/util.c
index f4aee4f..3c6cde5 100644
--- a/core/util.c
+++ b/core/util.c
@@ -747,6 +747,6 @@  int swupdate_file_setnonblock(int fd, bool block)
 	else
 		flags &= ~O_NONBLOCK;
 
-	return !(fcntl(fd, F_SETFL, flags) == -1);
+	return fcntl(fd, F_SETFL, flags);
 }