[OpenWrt-Devel] [PATCH] [libubox] ulog: check if /dev/kmsg is special file

John Crispin blogic at openwrt.org
Tue Aug 18 01:33:56 EDT 2015



On 17/08/2015 22:37, Sergiy Kibrik wrote:
> hi John,
> 
>> the patch is quite invasive. how about just using "r+"
>>
>> from the man page -->  "r+     Open for reading and writing.  The stream
>> is positioned at the beginning of the file."
>>
>> could you try the following and not apply any other changes ?
>>
>> 	John
>>
>> -	if ((kmsg = fopen("/dev/kmsg", "w")) != NULL) {
>> +	if ((kmsg = fopen("/dev/kmsg", "r+")) != NULL) {
> 
> should we go on without check for character special flag then?
> 

well, if we use r+ i think the problem will not arise so we can skip the
detection




> --
> regards,
> Sergey
> 
> 
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> 
_______________________________________________
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