Skip to content

Commit

Permalink
Fix windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
dfaust committed Nov 24, 2024
1 parent 0b5acec commit 97a9446
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions notify/src/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ impl ReadDirectoryChangesServer {
ptr::null_mut(),
OPEN_EXISTING,
FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED,
0,
ptr::null_mut(),
);

if handle == INVALID_HANDLE_VALUE {
Expand All @@ -206,7 +206,7 @@ impl ReadDirectoryChangesServer {
};
// every watcher gets its own semaphore to signal completion
let semaphore = unsafe { CreateSemaphoreW(ptr::null_mut(), 0, 1, ptr::null_mut()) };
if semaphore == 0 || semaphore == INVALID_HANDLE_VALUE {
if semaphore == ptr::null_mut() || semaphore == INVALID_HANDLE_VALUE {
unsafe {
CloseHandle(handle);
}
Expand Down Expand Up @@ -431,7 +431,7 @@ impl ReadDirectoryChangesWatcher {
let (cmd_tx, cmd_rx) = unbounded();

let wakeup_sem = unsafe { CreateSemaphoreW(ptr::null_mut(), 0, 1, ptr::null_mut()) };
if wakeup_sem == 0 || wakeup_sem == INVALID_HANDLE_VALUE {
if wakeup_sem == ptr::null_mut() || wakeup_sem == INVALID_HANDLE_VALUE {
return Err(Error::generic("Failed to create wakeup semaphore."));
}

Expand Down

0 comments on commit 97a9446

Please sign in to comment.