r335: report an error if query can't be opened

This commit is contained in:
Heng Li 2017-09-03 11:54:38 -04:00
parent f4a71d447f
commit 101b8bb97d
2 changed files with 6 additions and 2 deletions

2
main.c
View File

@ -6,7 +6,7 @@
#include "mmpriv.h"
#include "getopt.h"
#define MM_VERSION "2.1-r316-dirty"
#define MM_VERSION "2.1-r335-dirty"
#ifdef __linux__
#include <sys/resource.h>

6
map.c
View File

@ -382,7 +382,11 @@ int mm_map_file(const mm_idx_t *idx, const char *fn, const mm_mapopt_t *opt, int
pipeline_t pl;
memset(&pl, 0, sizeof(pipeline_t));
pl.fp = mm_bseq_open(fn);
if (pl.fp == 0) return -1;
if (pl.fp == 0) {
if (mm_verbose >= 1)
fprintf(stderr, "ERROR: failed to open file '%s'\n", fn);
return -1;
}
pl.opt = opt, pl.mi = idx;
pl.n_threads = n_threads, pl.mini_batch_size = mini_batch_size;
if ((opt->flag & MM_F_OUT_SAM) && !(opt->flag & MM_F_NO_SAM_SQ))