Skip to content

Commit 473e306

Browse files
authored
chore: update nix crate (denoland#26422)
Dedupes nix dependency, since `rustyline` depends on a newer version that what we currently use
1 parent 85709c7 commit 473e306

File tree

6 files changed

+17
-37
lines changed

6 files changed

+17
-37
lines changed

Cargo.lock

Lines changed: 8 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ quote = "1"
221221
syn = { version = "2", features = ["full", "extra-traits"] }
222222

223223
# unix
224-
nix = "=0.26.2"
224+
nix = "=0.27.1"
225225

226226
# windows deps
227227
junction = "=0.2.0"

ext/fs/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ serde.workspace = true
3131
thiserror.workspace = true
3232

3333
[target.'cfg(unix)'.dependencies]
34-
nix.workspace = true
34+
nix = { workspace = true, features = ["user"] }
3535

3636
[target.'cfg(windows)'.dependencies]
3737
winapi = { workspace = true, features = ["winbase"] }

runtime/ops/tty.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,8 @@ fn op_set_raw(
244244
let tty_mode_store = state.borrow::<TtyModeStore>().clone();
245245
let previous_mode = tty_mode_store.get(rid);
246246

247-
let raw_fd = handle_or_fd;
247+
// SAFETY: Nix crate requires value to implement the AsFd trait
248+
let raw_fd = unsafe { std::os::fd::BorrowedFd::borrow_raw(handle_or_fd) };
248249

249250
if is_raw {
250251
let mut raw = match previous_mode {

tests/util/server/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ lazy-regex.workspace = true
3535
libc.workspace = true
3636
lsp-types.workspace = true
3737
monch.workspace = true
38-
nix.workspace = true
38+
nix = { workspace = true, features = ["fs", "term", "signal"] }
3939
once_cell.workspace = true
4040
os_pipe.workspace = true
4141
parking_lot.workspace = true

tests/util/server/src/pty.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,10 +297,12 @@ fn setup_pty(fd: i32) {
297297
use nix::sys::termios::tcsetattr;
298298
use nix::sys::termios::SetArg;
299299

300-
let mut term = tcgetattr(fd).unwrap();
300+
// SAFETY: Nix crate requires value to implement the AsFd trait
301+
let as_fd = unsafe { std::os::fd::BorrowedFd::borrow_raw(fd) };
302+
let mut term = tcgetattr(as_fd).unwrap();
301303
// disable cooked mode
302304
term.local_flags.remove(termios::LocalFlags::ICANON);
303-
tcsetattr(fd, SetArg::TCSANOW, &term).unwrap();
305+
tcsetattr(as_fd, SetArg::TCSANOW, &term).unwrap();
304306

305307
// turn on non-blocking mode so we get timeouts
306308
let flags = fcntl(fd, FcntlArg::F_GETFL).unwrap();

0 commit comments

Comments
 (0)