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

Check for whether output is correctly written #132

Closed
wants to merge 1 commit into from

Conversation

luispedro
Copy link

If puts() returns an error (e.g., writing to a full disk), then
immediately exit(1). Also, flush the output at the end and check if
that operation was successful before exiting with a zero error code.

fixes #103

Calling exit(1) from within a pthread is a bit heavy handed, but it's allowed by the pthread docs and works as expected (stops all threads and exits with the given error code).

If `puts()` returns an error (e.g., writing to a full disk), then
immediately `exit(1)`. Also, flush the output at the end and check if
that operation was successful before exiting with a zero error code.

fixes lh3#103
@armintoepfer
Copy link
Contributor

I'd prefer exit(EXIT_FAILURE)

lh3 added a commit that referenced this pull request Mar 22, 2018
@lh3
Copy link
Owner

lh3 commented Mar 22, 2018

Thanks for this PR. I reimplemented in a slightly different way. Note that I am not propagating error code. I know a library should not exit in the middle. However, minimap2 may need quite a bit code refactoring to behave like a proper library. Hope this happens some day.

Addressed via 623b5d9.

@lh3 lh3 closed this Mar 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

minimap2 doesn't detect or fail if output destination runs out of space
3 participants