[LEDE-DEV] [PATCH 1/2] [ubox] syslog: use realloc to change log buffer size

Conor O'Gorman i at conorogorman.net
Wed May 18 07:08:53 PDT 2016


On 18/05/16 15:03, Dan Bugnar wrote:
> For the larger size it takes the distance from the old log and newest 
> and added to _log to have the new newest, same for the oldest. It 
> doesn't matter if the newest > oldest OR oldest > newest.
If the oldest > newest, there will be a blank area, the new space. How 
will this be handled during log printing?

> And if the size is smaller than we will have a fresh new smaller 
> buffer with the newest and oldest pointing to _log(start).
>
> If it is possible that a message is added to the old log after the 
> realloc call is done and the log doesn't point to the new buffer, we 
> will loose that message.
For both of these situations, it is possible to lose messages. I thought 
the intention was not to lose messages?

Conor



More information about the Lede-dev mailing list