From 37d2b04af6059010ed0db7c47ed07a35e1e34d8b Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Fri, 18 Mar 2022 10:29:01 -0700 Subject: [PATCH] fix some warnings on windows --- config/src/daemon.rs | 5 +++++ pty/src/serial.rs | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/config/src/daemon.rs b/config/src/daemon.rs index f276f3024..8a2c09683 100644 --- a/config/src/daemon.rs +++ b/config/src/daemon.rs @@ -25,6 +25,11 @@ pub fn set_sticky_bit(path: &Path) { let _ = std::fs::set_permissions(&path, perms); } } + + #[cfg(windows)] + { + let _ = path; + } } fn open_log(path: PathBuf) -> anyhow::Result { diff --git a/pty/src/serial.rs b/pty/src/serial.rs index 2ffb9c26b..246a3e557 100644 --- a/pty/src/serial.rs +++ b/pty/src/serial.rs @@ -10,7 +10,7 @@ use crate::{ SlavePty, }; use anyhow::{ensure, Context}; -use filedescriptor::{poll, pollfd, AsRawSocketDescriptor, FileDescriptor, POLLIN}; +use filedescriptor::FileDescriptor; use serial::{ BaudRate, CharSize, FlowControl, Parity, PortSettings, SerialPort, StopBits, SystemPort, }; @@ -241,6 +241,7 @@ impl Read for Reader { loop { #[cfg(unix)] { + use filedescriptor::{poll, pollfd, AsRawSocketDescriptor, POLLIN}; // The serial crate puts the serial port in non-blocking mode, // so we must explicitly poll for ourselves here to avoid a // busy loop.