Skip to content
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

Update sshpty.c #448

Closed
wants to merge 1 commit into from
Closed

Update sshpty.c #448

wants to merge 1 commit into from

Conversation

weedcookie
Copy link

According to man pages open return -1 on error, which means a value bigger than or equal to zero is a valid file descriptor.

According to man pages `open` return -1 on error, which means a value bigger than or equal to zero is a valid file descriptor.
@daztucker
Copy link
Contributor

According to man pages open return -1 on error

That's true, however your patch is incorrect. If you look at what it's trying to do:

  • Verify that we are successfully disconnected from the controlling tty.

/dev/tty is present when a process has controlling tty. This means that if the open succeeds then the process still has a controlling tty, which means that the attempt to disconnect from it failed.

@daztucker daztucker closed this Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants