[PATCH] tools: image-host.c: use correct variable for strerrno

Philippe Reynes philippe.reynes at softathome.com
Fri Nov 13 15:15:18 CET 2020


In the function get_random_data, strerrno is called with
the variable ret (which is the return of the function
clock_gettime). It should be called with errnor. This
commit fixes this mistake.

Reported-by: Coverity (CID: 312956)
Signed-off-by: Philippe Reynes <philippe.reynes at softathome.com>
---
 tools/image-host.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/image-host.c b/tools/image-host.c
index 7cef78eab8..24079b8a27 100644
--- a/tools/image-host.c
+++ b/tools/image-host.c
@@ -335,7 +335,7 @@ static int get_random_data(void *data, int size)
 	ret = clock_gettime(CLOCK_MONOTONIC, &date);
 	if (ret < 0) {
 		printf("%s: clock_gettime has failed (err=%d, str=%s)\n",
-		       __func__, ret, strerror(ret));
+		       __func__, ret, strerror(errno));
 		goto out;
 	}
 
-- 
2.17.1



More information about the U-Boot mailing list