Race is possible in ulog_kmsg(): if no /dev/kmsg exists
(e.g. while /dev gets re-mounted) regular file created instead.
>From this point system goes without kernel logger:
special character file can't be created anymore, all clients keep
overwriting single message in regular file.
To avoid this we open file in "r+" mode which doesn't create
file if it's not found.
Signed-off-by: Sergiy Kibrik <sakib@meta.ua>
Cc: John Crispin <blogic@openwrt.org>
The ulog api is intended to be used by procd, fstools, ubox etc. to provide
a generic logging api for early boot messages and automatic switching between
syslog / kmsg / stdout depending on the way the process is executed.
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>