r389: return non-zero upon errors
This commit is contained in:
parent
19cb7cd7ed
commit
1a2bd2cf91
10
fastmap.c
10
fastmap.c
|
|
@ -90,9 +90,12 @@ int main_mem(int argc, char *argv[])
|
||||||
|
|
||||||
bwa_fill_scmat(opt->a, opt->b, opt->mat);
|
bwa_fill_scmat(opt->a, opt->b, opt->mat);
|
||||||
if ((idx = bwa_idx_load(argv[optind], BWA_IDX_ALL)) == 0) return 1; // FIXME: memory leak
|
if ((idx = bwa_idx_load(argv[optind], BWA_IDX_ALL)) == 0) return 1; // FIXME: memory leak
|
||||||
bwa_print_sam_hdr(idx->bns, rg_line);
|
|
||||||
|
|
||||||
ko = kopen(argv[optind + 1], &fd);
|
ko = kopen(argv[optind + 1], &fd);
|
||||||
|
if (ko == 0) {
|
||||||
|
if (bwa_verbose >= 1) fprintf(stderr, "[E::%s] fail to open file `%s'.\n", __func__, argv[optind + 1]);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
fp = gzdopen(fd, "r");
|
fp = gzdopen(fd, "r");
|
||||||
ks = kseq_init(fp);
|
ks = kseq_init(fp);
|
||||||
if (optind + 2 < argc) {
|
if (optind + 2 < argc) {
|
||||||
|
|
@ -101,11 +104,16 @@ int main_mem(int argc, char *argv[])
|
||||||
fprintf(stderr, "[W::%s] when '-p' is in use, the second query file will be ignored.\n", __func__);
|
fprintf(stderr, "[W::%s] when '-p' is in use, the second query file will be ignored.\n", __func__);
|
||||||
} else {
|
} else {
|
||||||
ko2 = kopen(argv[optind + 2], &fd2);
|
ko2 = kopen(argv[optind + 2], &fd2);
|
||||||
|
if (ko2 == 0) {
|
||||||
|
if (bwa_verbose >= 1) fprintf(stderr, "[E::%s] fail to open file `%s'.\n", __func__, argv[optind + 2]);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
fp2 = gzdopen(fd2, "r");
|
fp2 = gzdopen(fd2, "r");
|
||||||
ks2 = kseq_init(fp2);
|
ks2 = kseq_init(fp2);
|
||||||
opt->flag |= MEM_F_PE;
|
opt->flag |= MEM_F_PE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
bwa_print_sam_hdr(idx->bns, rg_line);
|
||||||
while ((seqs = bseq_read(opt->chunk_size * opt->n_threads, &n, ks, ks2)) != 0) {
|
while ((seqs = bseq_read(opt->chunk_size * opt->n_threads, &n, ks, ks2)) != 0) {
|
||||||
int64_t size = 0;
|
int64_t size = 0;
|
||||||
if ((opt->flag & MEM_F_PE) && (n&1) == 1) {
|
if ((opt->flag & MEM_F_PE) && (n&1) == 1) {
|
||||||
|
|
|
||||||
4
kopen.c
4
kopen.c
|
|
@ -292,14 +292,14 @@ void *kopen(const char *fn, int *_fd)
|
||||||
#else
|
#else
|
||||||
*_fd = open(fn, O_RDONLY);
|
*_fd = open(fn, O_RDONLY);
|
||||||
#endif
|
#endif
|
||||||
if (*_fd) {
|
if (*_fd >= 0) {
|
||||||
aux = calloc(1, sizeof(koaux_t));
|
aux = calloc(1, sizeof(koaux_t));
|
||||||
aux->type = KO_FILE;
|
aux->type = KO_FILE;
|
||||||
aux->fd = *_fd;
|
aux->fd = *_fd;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*_fd = aux->fd;
|
if (aux) *_fd = aux->fd;
|
||||||
return aux;
|
return aux;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
4
main.c
4
main.c
|
|
@ -3,7 +3,7 @@
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
#ifndef PACKAGE_VERSION
|
#ifndef PACKAGE_VERSION
|
||||||
#define PACKAGE_VERSION "0.7.4-r388-beta"
|
#define PACKAGE_VERSION "0.7.4-r389-beta"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int bwa_fa2pac(int argc, char *argv[]);
|
int bwa_fa2pac(int argc, char *argv[]);
|
||||||
|
|
@ -92,5 +92,5 @@ int main(int argc, char *argv[])
|
||||||
fprintf(stderr, " %s", argv[i]);
|
fprintf(stderr, " %s", argv[i]);
|
||||||
fprintf(stderr, "\n[%s] Real time: %.3f sec; CPU: %.3f sec\n", __func__, realtime() - t_real, cputime());
|
fprintf(stderr, "\n[%s] Real time: %.3f sec; CPU: %.3f sec\n", __func__, realtime() - t_real, cputime());
|
||||||
}
|
}
|
||||||
return 0;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue