summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDavid Lönnhager <david.l@mullvad.net>2022-02-07 15:16:34 +0100
committerDavid Lönnhager <david.l@mullvad.net>2022-02-07 15:28:35 +0100
commit0d96d71d9de47c6fc50d006edbcd92dccd44ef91 (patch)
treec9b98006cc9642418539fc1eaae2f2c3fac46ba1
parent4605358fcfae03ee9f3056f32d5de138a797bd31 (diff)
downloadmullvadvpn-0d96d71d9de47c6fc50d006edbcd92dccd44ef91.tar.xz
mullvadvpn-0d96d71d9de47c6fc50d006edbcd92dccd44ef91.zip
Ignore volumes without known file systems
-rw-r--r--talpid-core/src/split_tunnel/windows/path_monitor.rs23
1 files changed, 16 insertions, 7 deletions
diff --git a/talpid-core/src/split_tunnel/windows/path_monitor.rs b/talpid-core/src/split_tunnel/windows/path_monitor.rs
index b27deb1e21..71e909a09b 100644
--- a/talpid-core/src/split_tunnel/windows/path_monitor.rs
+++ b/talpid-core/src/split_tunnel/windows/path_monitor.rs
@@ -17,7 +17,10 @@ use winapi::{
self,
shared::{
minwindef::TRUE,
- winerror::{ERROR_NOT_FOUND, ERROR_OPERATION_ABORTED},
+ winerror::{
+ ERROR_NOT_FOUND, ERROR_OPERATION_ABORTED, ERROR_PATH_NOT_FOUND,
+ ERROR_UNRECOGNIZED_VOLUME,
+ },
},
um::{
fileapi::{GetFileAttributesW, GetFullPathNameW},
@@ -609,14 +612,20 @@ impl PathMonitor {
let index = self.dir_contexts.len();
let mut ctx = match DirContext::new(&path.prefix, self.port_handle.clone(), index) {
Ok(ctx) => ctx,
- Err(error) if error.kind() == io::ErrorKind::NotFound => {
- log::warn!(
- "Not monitoring reparse points on {} since it does not exist",
- path.prefix.to_string_lossy()
- );
+ Err(error) => {
+ match error.raw_os_error().map(|code| code as u32) {
+ Some(ERROR_NOT_FOUND)
+ | Some(ERROR_PATH_NOT_FOUND)
+ | Some(ERROR_UNRECOGNIZED_VOLUME) => {
+ log::trace!(
+ "Not monitoring reparse points on {} since it does not exist",
+ path.prefix.to_string_lossy()
+ );
+ }
+ _ => return Err(error),
+ }
continue;
}
- Err(error) => return Err(error),
};
ctx.read_directory_changes()?;
self.dir_contexts.push(ctx);