Skip to content

Commit 40c75ef

Browse files
committed
fix: Use type inference for ioctl to support both glibc and musl
The ioctl request type differs between glibc (c_ulong) and musl (c_int). Using `as _` allows the compiler to infer the correct type for each target.
1 parent a15a8fb commit 40c75ef

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/server/shell.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ impl ShellSession {
177177

178178
// Set controlling terminal
179179
// TIOCSCTTY with arg 0 means don't steal from another session
180-
if nix::libc::ioctl(0, nix::libc::TIOCSCTTY as nix::libc::c_ulong, 0) < 0 {
180+
// Use `as _` to handle type differences between glibc (c_ulong) and musl (c_int)
181+
if nix::libc::ioctl(0, nix::libc::TIOCSCTTY as _, 0) < 0 {
181182
return Err(std::io::Error::last_os_error());
182183
}
183184

0 commit comments

Comments
 (0)