No subject


Thu Jun 25 05:52:11 EDT 2020


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 at meta.ua>
Cc: John Crispin <blogic at openwrt.org>
---
 ulog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ulog.c b/ulog.c
index 776a0c4..80b67ac 100644
--- a/ulog.c
+++ b/ulog.c
@@ -90,7 +90,7 @@ static void ulog_kmsg(int priority, const char *fmt, va_list ap)
 {
 	FILE *kmsg;
 
-	if ((kmsg = fopen("/dev/kmsg", "w")) != NULL) {
+	if ((kmsg = fopen("/dev/kmsg", "r+")) != NULL) {
 		fprintf(kmsg, "<%u>", priority);
 
 		if (_ulog_ident)
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list