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

fix(Common): fixes for ffProcessAppendOutput #640

Merged
merged 1 commit into from
Nov 30, 2023

Conversation

apocelipes
Copy link
Contributor

  • Use pipe2 on Linux and BSDs, which can set all flags through a single syscall.
  • macOS/darwin does not support pipe2, add a wrapper for it.
  • Close pipes when fork() failed. These fds should be closed when the function returns.
  • Set O_CLOEXEC at pipes, the exec() family of functions will close this fds automatically.
  • Use _exit instead of exit. Exit calls the callbacks registered by atexit and flushes the stdio's buffer, which can lead to some unexpected behavior, especially after an exec syscall failure.
  • Fix timeout.
  • Not use non-blocking IO. Because we only wait for one file, and cannot do other things during waiting.

For #639

- Use pipe2 on Linux and BSDs, which can set all flags through a single syscall.
- macOS/darwin does not support pipe2, add a wrapper for it.
- Close pipes when fork() failed. These fds should be closed when
  the function returns.
- Set O_CLOEXEC at pipes, the exec() family of functions will close
  this fds automatically.
- Use _exit instead of exit. Exit calls the callbacks registered by atexit
  and flushes the stdio's buffer, which can lead to some unexpected behavior,
  especially after an exec syscall failure.
- Fix timeout.
- Not use non-blocking IO. because we only wait for one file, and cannot
  do other things during waiting.
@CarterLi CarterLi merged commit 5392277 into fastfetch-cli:dev Nov 30, 2023
18 checks passed
@apocelipes apocelipes deleted the fix-timeout branch November 30, 2023 04:56
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