Updated deprecated names
This commit is contained in:
parent
2e25574ff1
commit
ca684da044
1 changed files with 4 additions and 4 deletions
|
|
@ -108,7 +108,7 @@ proc del*(monitor: FSMonitor, wd: cint) =
|
||||||
|
|
||||||
proc getEvent(m: FSMonitor, fd: cint): seq[MonitorEvent] =
|
proc getEvent(m: FSMonitor, fd: cint): seq[MonitorEvent] =
|
||||||
result = @[]
|
result = @[]
|
||||||
let size = (sizeof(TINotifyEvent)+2000)*MaxEvents
|
let size = (sizeof(INotifyEvent)+2000)*MaxEvents
|
||||||
var buffer = newString(size)
|
var buffer = newString(size)
|
||||||
|
|
||||||
let le = read(fd, addr(buffer[0]), size)
|
let le = read(fd, addr(buffer[0]), size)
|
||||||
|
|
@ -117,7 +117,7 @@ proc getEvent(m: FSMonitor, fd: cint): seq[MonitorEvent] =
|
||||||
|
|
||||||
var i = 0
|
var i = 0
|
||||||
while i < le:
|
while i < le:
|
||||||
var event = cast[ptr TINotifyEvent](addr(buffer[i]))
|
var event = cast[ptr INotifyEvent](addr(buffer[i]))
|
||||||
var mev: MonitorEvent
|
var mev: MonitorEvent
|
||||||
mev.wd = event.wd
|
mev.wd = event.wd
|
||||||
if event.len.int != 0:
|
if event.len.int != 0:
|
||||||
|
|
@ -129,7 +129,7 @@ proc getEvent(m: FSMonitor, fd: cint): seq[MonitorEvent] =
|
||||||
if (event.mask.int and IN_MOVED_FROM) != 0:
|
if (event.mask.int and IN_MOVED_FROM) != 0:
|
||||||
# Moved from event, add to m's collection
|
# Moved from event, add to m's collection
|
||||||
movedFrom.add(event.cookie.cint, (mev.wd, mev.name))
|
movedFrom.add(event.cookie.cint, (mev.wd, mev.name))
|
||||||
inc(i, sizeof(TINotifyEvent) + event.len.int)
|
inc(i, sizeof(INotifyEvent) + event.len.int)
|
||||||
continue
|
continue
|
||||||
elif (event.mask.int and IN_MOVED_TO) != 0:
|
elif (event.mask.int and IN_MOVED_TO) != 0:
|
||||||
mev.kind = MonitorMoved
|
mev.kind = MonitorMoved
|
||||||
|
|
@ -159,7 +159,7 @@ proc getEvent(m: FSMonitor, fd: cint): seq[MonitorEvent] =
|
||||||
mev.fullname = ""
|
mev.fullname = ""
|
||||||
|
|
||||||
result.add(mev)
|
result.add(mev)
|
||||||
inc(i, sizeof(TINotifyEvent) + event.len.int)
|
inc(i, sizeof(INotifyEvent) + event.len.int)
|
||||||
|
|
||||||
# If movedFrom events have not been matched with a moveTo. File has
|
# If movedFrom events have not been matched with a moveTo. File has
|
||||||
# been moved to an unwatched location, emit a MonitorDelete.
|
# been moved to an unwatched location, emit a MonitorDelete.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue