Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check fclose(stdout) at the end of main()
Since PR samtools/htslib#1665, hts_open("-", "w") / hts_close() no longer actually closes stdout. Close it at the end of main() so there is an opportunity to detect I/O errors in previously-uncommitted writes. Ignore EBADF as other code may have already closed stdout, e.g., either particular subcommands or when (dynamically) linked against an older version of HTSlib.
- Loading branch information