-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3.1.0 switch to rustix again for glibc compat #32
Conversation
index.d.ts
Outdated
@@ -27,7 +27,7 @@ export class Pty { | |||
* Returns a file descriptor for the PTY controller. | |||
* See the docstring of the class for an usage example. | |||
*/ | |||
fd(): c_int | |||
fd(): RawFd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't think this is a legit type, ha. how can we make this return number
?
src/lib.rs
Outdated
@@ -272,7 +269,7 @@ impl Pty { | |||
/// See the docstring of the class for an usage example. | |||
#[napi] | |||
#[allow(dead_code)] | |||
pub fn fd(&mut self) -> Result<c_int, napi::Error> { | |||
pub fn fd(&mut self) -> Result<RawFd, napi::Error> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pub fn fd(&mut self) -> Result<RawFd, napi::Error> { | |
pub fn fd(&mut self) -> Result<i32, napi::Error> { |
it's disgusting, but i think we need to cast this to i32
so that the codegen emits a nice number
https://napi.rs/docs/concepts/function
src/lib.rs
Outdated
let controller_fd = unsafe { OwnedFd::from_raw_fd(raw_controller_fd) }; | ||
poll_controller_fd_until_read(controller_fd); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm i think this is unsafe, because we don't truly own the raw controller fd in this context, and exiting the poll will .close
it! but then we will .close
it again in .close()
!!!
we probably need to reintroduce the fd copying that we had earlier 😭.
this is a lil borked, closing for now and trying ubuntu-2004 |
No description provided.