Merge branch 'sigar-1.6'
This commit is contained in:
commit
bee9eb97a2
|
@ -158,7 +158,18 @@ public class EventLogThread implements Runnable {
|
||||||
// cleaner way to go, but we cannot interrupt
|
// cleaner way to go, but we cannot interrupt
|
||||||
// a native system call.
|
// a native system call.
|
||||||
int lastEvent = log.getNewestRecord();
|
int lastEvent = log.getNewestRecord();
|
||||||
|
if (lastEvent < curEvent) {
|
||||||
|
logger.debug(this.logName + " EventLog has changed, re-opening");
|
||||||
|
try { log.close(); } catch (Win32Exception e) {}
|
||||||
|
log.open(this.logName);
|
||||||
|
curEvent = log.getOldestRecord();
|
||||||
|
lastEvent = log.getNewestRecord();
|
||||||
|
}
|
||||||
|
|
||||||
if (lastEvent > curEvent) {
|
if (lastEvent > curEvent) {
|
||||||
|
if (curEvent == -1) {
|
||||||
|
curEvent = 0; //log was cleared
|
||||||
|
}
|
||||||
handleEvents(log, curEvent, lastEvent);
|
handleEvents(log, curEvent, lastEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue