mirror of
https://github.com/lh3/minimap2.git
synced 2026-09-28 10:48:12 +08:00
Report errno on file opening failures and I/O errors
Add the underlying operating system error (usually "No such file" or "Out of space" respectively, but highly informative when it is not) to these error messages.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include "kthread.h"
|
||||
#include "kvec.h"
|
||||
#include "kalloc.h"
|
||||
@@ -622,7 +623,7 @@ static mm_bseq_file_t **open_bseqs(int n, const char **fn)
|
||||
for (i = 0; i < n; ++i) {
|
||||
if ((fp[i] = mm_bseq_open(fn[i])) == 0) {
|
||||
if (mm_verbose >= 1)
|
||||
fprintf(stderr, "ERROR: failed to open file '%s'\n", fn[i]);
|
||||
fprintf(stderr, "ERROR: failed to open file '%s': %s\n", fn[i], strerror(errno));
|
||||
for (j = 0; j < i; ++j)
|
||||
mm_bseq_close(fp[j]);
|
||||
free(fp);
|
||||
|
||||
Reference in New Issue
Block a user