Commit graph

5 commits

Author SHA1 Message Date
Rosen Penev
8fc1c3053e libubox: replace strtok with _r version.
_r is re-entrant. Also happens to silence a cppcheck warning.

Signed-off by: Rosen Penev <rosenp@gmail.com>
2016-12-24 11:03:29 +01:00
Sergiy Kibrik
136a519626 ulog: avoid accidental /dev/kmsg creation
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>
2015-09-15 07:29:59 +02:00
Yousong Zhou
d1c66ef113 ulog: always use stderr for ulog_stdio().
stdout is for normal program output.

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2015-06-14 15:45:57 +02:00
Jo-Philipp Wich
2a9edb4642 ulog: implement ulog_close()
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-02-26 13:35:50 +01:00
Jo-Philipp Wich
ca6d547205 ulog: introduce new simple logging api
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>
2015-02-26 10:43:56 +01:00