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 sendmail invocation #7

Merged
merged 1 commit into from
May 27, 2022
Merged

Fix sendmail invocation #7

merged 1 commit into from
May 27, 2022

Conversation

inliquid
Copy link
Contributor

@inliquid inliquid commented May 26, 2022

I discovered a couple more issues and I hope this PR will fix them.

  1. Interaction with sendmail still "hangs", because Stderr is read before Stdin was closed, should be reversed.
  2. Stderr was not read, because io.Reader's Read method does not read into nil slice, according to documentation it will read up to len(p) where p is byte slice.
  3. After explicit call to close of Stdin pipe was added, there is no need in deferred Close, plus according to documentation both Stderr and Stdin pipes will be closed automatically when Wait sees program exit.

- Fix reading of Stderr contents
- Remove redundand calls to `Close`
@inliquid inliquid marked this pull request as ready for review May 26, 2022 11:48
@wneessen
Copy link
Owner

Thanks for the PR! Looks good to me.

@wneessen wneessen merged commit eed1eee into wneessen:main May 27, 2022
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