Skip to content

Commit

Permalink
Update ci scripts, formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
cmyr committed Feb 1, 2018
1 parent 168f098 commit ed2e729
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 38 deletions.
3 changes: 2 additions & 1 deletion backend-fsevent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ workspace = ".."
libc = "*"
futures = "0.1.10"
fsevent = "0.2"
fsevent-sys = "0.1.3"
fsevent-sys = "0.1.6"
tempdir = "0.3.5"

[dependencies.notify-backend]
path = "../backend"
68 changes: 34 additions & 34 deletions backend-fsevent/src/watcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,41 +54,41 @@ impl FsEventWatcher {
let latency = 0.0;
let since_when = fs::kFSEventStreamEventIdSinceNow;

let ctx = Box::new(Context { queue });
let stream_ctx = fs::FSEventStreamContext {
version: 0,
info: unsafe { mem::transmute(Box::into_raw(ctx)) },
retain: cf::NULL,
copy_description: cf::NULL,
};

let cb = callback as *mut _;
unsafe {
let fse_stream = fs::FSEventStreamCreate(cf::kCFAllocatorDefault,
cb,
&stream_ctx,
paths,
since_when,
latency,
flags);

let runloop = cf::CFRunLoopGetCurrent();

runloop_ptr2.store(runloop as *mut libc::c_void,
atomic::Ordering::Relaxed);

ptr_set_barrier2.wait();

fs::FSEventStreamScheduleWithRunLoop(fse_stream, runloop,
cf::kCFRunLoopDefaultMode);
fs::FSEventStreamStart(fse_stream);
let ctx = Box::new(Context::new(queue));
let stream_ctx = fs::FSEventStreamContext {
version: 0,
info: unsafe { mem::transmute(Box::into_raw(ctx)) },
retain: cf::NULL,
copy_description: cf::NULL,
};

cf::CFRunLoopRun();
// the previous call blocks until we cancel from another thread
fs::FSEventStreamStop(fse_stream);
fs::FSEventStreamInvalidate(fse_stream);
fs::FSEventStreamRelease(fse_stream);
}
let cb = callback as *mut _;
unsafe {
let fse_stream = fs::FSEventStreamCreate(cf::kCFAllocatorDefault,
cb,
&stream_ctx,
paths,
since_when,
latency,
flags);

let runloop = cf::CFRunLoopGetCurrent();

runloop_ptr2.store(runloop as *mut libc::c_void,
atomic::Ordering::Relaxed);

ptr_set_barrier2.wait();

fs::FSEventStreamScheduleWithRunLoop(fse_stream, runloop,
cf::kCFRunLoopDefaultMode);
fs::FSEventStreamStart(fse_stream);

cf::CFRunLoopRun();
// the previous call blocks until we cancel from another thread
fs::FSEventStreamStop(fse_stream);
fs::FSEventStreamInvalidate(fse_stream);
fs::FSEventStreamRelease(fse_stream);
}
});

ptr_set_barrier.wait();
Expand Down
4 changes: 2 additions & 2 deletions ci/cross-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ target() {
2>&1 | tee $(logfile $check $target notify-backend-inotify)
elif [[ "$target" =~ -darwin$ ]]; then
echo not ready yet
#$check $target -p notify-backend-fsevents \
# 2>&1 | tee $(logfile $check $target notify-backend-fsevents)
$check $target -p notify-backend-fsevent \
2>&1 | tee $(logfile $check $target notify-backend-fsevent)
elif [[ "$target" =~ bsd ]]; then
$check $target -p notify-backend-kqueue \
2>&1 | tee $(logfile $check $target notify-backend-kqueue)
Expand Down
3 changes: 2 additions & 1 deletion ci/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ main() {
echo bothx test -p notify-backend-poll-tree

if [[ "$TARGET" =~ -darwin$ ]]; then
echo bothx test -p notify-backend-fsevents
echo bothx test -p notify-backend-fsevent
bothx test -p notify-backend-fsevent
elif [[ "$TARGET" =~ -linux- ]]; then
bothx test -p notify-backend-inotify
fi
Expand Down

0 comments on commit ed2e729

Please sign in to comment.