Skip to content
Commit 611fe36d authored by Antonio Borneo's avatar Antonio Borneo Committed by Simon Ser
Browse files

log: remove "%m" from format strings by using strerror(errno)



The printf() format specifier "%m" is a glibc extension to print
the string returned by strerror(errno). While supported by other
libraries (e.g. uClibc and musl), it is not widely portable.

In Weston code the format string is often passed to a logging
function that calls other syscalls before the conversion of "%m"
takes place. If one of such syscall modifies the value in errno,
the conversion of "%m" will incorrectly report the error string
corresponding to the new value of errno.

Remove all the occurrences of the specifier "%m" in Weston code
by using directly the string returned by strerror(errno).
While there, fix some minor indentation issue.

Signed-off-by: default avatarAntonio Borneo <borneo.antonio@gmail.com>
(cherry picked from commit 39578636)
parent 45720b34
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment