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

2016-05-18 Thread John Crispin
On 18/05/2016 16:08, Conor O'Gorman wrote: > 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 old

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

2016-05-18 Thread Conor O'Gorman
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

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

2016-05-18 Thread Conor O'Gorman
On 18/05/16 10:45, Dan Bugnar wrote: + newest = (_log + (newest - log)); newest->size = 0; - oldest = log = _log; + memset(newest, 0, size - log_size); + oldest = (_log + (oldest - log)); + log = _log;

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

2016-05-18 Thread Dan Bugnar
From: Dan Bugnar Change the log buffer size and copy the messages. Signed-off-by: Dan Bugnar --- log/syslog.c | 37 +++-- log/syslog.h | 2 +- 2 files changed, 16 insertions(+), 23 deletions(-) diff --git a/log/syslog.c b/log/syslog.c index e8b6774..d6cb868 10

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

2016-05-13 Thread Alexandru Ardelean
On Thu, May 12, 2016 at 3:09 PM, Dan Bugnar wrote: > From: Dan Bugnar > > Change the log buffer size and copy the messages. > > Signed-off-by: Dan Bugnar > --- > log/syslog.c | 37 +++-- > log/syslog.h | 2 +- > 2 files changed, 16 insertions(+), 23 deletions(-)

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

2016-05-12 Thread Dan Bugnar
From: Dan Bugnar Change the log buffer size and copy the messages. Signed-off-by: Dan Bugnar --- log/syslog.c | 37 +++-- log/syslog.h | 2 +- 2 files changed, 16 insertions(+), 23 deletions(-) diff --git a/log/syslog.c b/log/syslog.c index e8b6774..d6cb868 10