tools: image-host.c: use correct variable for strerrno
PATCH 1/1 tools: image-host.c: use correct variable for strerrno
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.
--- tools/image-host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/image-host.c +1 -1
@@ -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; }
Signature · 1 line
2.17.1
PATCH 1/1 tools: image-host.c: use correct variable for strerrno
Hi Philippe,
Quoted 11 lines · Philippe Reynes
In the function
get_random_data, strerrno is called with the variable ret (which is the return of the functionclock_gettime). It should be called with errnor. This commit fixes this mistake.Reported-by Coverity (CID: 312956)Signed-off-by Philippe Reynes <[email protected]>--- tools/image-host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
PATCH 1/1 tools: image-host.c: use correct variable for strerrno
In reply to Philippe ReynesQuoted 8 lines · Philippe Reynes
In the function
get_random_data, strerrno is called with the variable ret (which is the return of the functionclock_gettime). It should be called with errnor. This commit fixes this mistake.Reported-by Coverity (CID: 312956)Signed-off-by Philippe Reynes <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201119/d090001d/attachment-0001.sig>