]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
tools: image-host.c: use correct variable for strerrno
authorPhilippe Reynes <philippe.reynes@softathome.com>
Fri, 13 Nov 2020 14:15:18 +0000 (15:15 +0100)
committerTom Rini <trini@konsulko.com>
Thu, 19 Nov 2020 14:45:49 +0000 (09:45 -0500)
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@softathome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
tools/image-host.c

index 5e1dec233840ce560e167962d4804d1f9d4f4fc4..e32cc642579ede6591e0bda065525673c66d3ee7 100644 (file)
@@ -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;
        }