Fix how %m behaves in the log format 36/302936/1
authorMichal Bloch <m.bloch@samsung.com>
Fri, 8 Dec 2023 14:04:26 +0000 (15:04 +0100)
committerMichal Bloch <m.bloch@samsung.com>
Fri, 15 Dec 2023 17:01:33 +0000 (18:01 +0100)
commitccad98f51ab7334952266dd752aa374d58f0993c
tree8b40ec612080c71f6405139c47ce1c03deda6fcb
parent7989bacdff5e5df8f38fbbfab3ff2a2ed2adfb3c
Fix how %m behaves in the log format

%m is supposed to mean the original state of errno as it was at the time
libdlog was called. But we used to perform syscalls that changed it.
Make sure that we immanentize the message first, before any syscalls,
so that %m uses the correct value of errno.

Change-Id: I5b594b28fa7dc8c2ec590231c5c0903de75eddee
src/libdlog/log.c