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

[STYLE] Make IO redirect names more clear #339

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

itislu
Copy link
Collaborator

@itislu itislu commented Jun 7, 2024

  • Rename handle_io_redirect() to open_io_files().
  • Rename stdio_bind.c to stdio_redirect.c because "binding" file descriptors is commonly used with sockets, not with files.

@LeaYeh
Copy link
Owner

LeaYeh commented Jun 8, 2024

I still think handle_* is more make sense for me

@itislu itislu force-pushed the style-io-redirect-names branch 3 times, most recently from fe437aa to cbef631 Compare July 5, 2024 14:21
@itislu itislu force-pushed the style-io-redirect-names branch from cbef631 to ebd3ba1 Compare July 10, 2024 05:26
@itislu
Copy link
Collaborator Author

itislu commented Jul 10, 2024

I still think handle_* is more make sense for me

The problem is that f.e. handle_red_out() sounds like it will handle the redirection completely, meaning it will redirect STDOUT to a file. But that's not what that function does. The actual redirection with dup2() is done by the redirect_*() functions.
I never know what the handle_*() functions actually do.

@itislu itislu force-pushed the style-io-redirect-names branch 3 times, most recently from 3f00bb5 to 9da29f0 Compare July 15, 2024 03:22
"Binding" file descriptors is commonly used with sockets, not with files.
@itislu itislu force-pushed the style-io-redirect-names branch from 9da29f0 to 4da8fbe Compare December 14, 2024 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore A routine task
Projects
Status: Ready
Development

Successfully merging this pull request may close these issues.

2 participants