diff --git a/hyb_bwa.c b/hyb_bwa.c index 074ce9f..b480856 100644 --- a/hyb_bwa.c +++ b/hyb_bwa.c @@ -338,7 +338,7 @@ HybridIndex* bwa_hyb_idx_load_from_disk(const char* idx_prefix) { #define __load_hybrid_idx_code(suffix, data) \ sec_time = realtime(); \ sprintf(fn, "%s%s", idx_prefix, suffix); \ - err_check_true(stat(fn, &st), 0); \ + err_check_true(stat(fn, &st), 0, fn); \ fp = xopen(fn, "r"); \ data = (uint8_t*)malloc(st.st_size); \ err_fread_noeof(data, 1, st.st_size, fp); \ diff --git a/hyb_utils.c b/hyb_utils.c index 821cd38..825a329 100644 --- a/hyb_utils.c +++ b/hyb_utils.c @@ -23,7 +23,7 @@ HybridIndex* load_hybrid_idx(const char* prefix) { #define __load_hybrid_idx_code(suffix, data) \ sprintf(fn, "%s%s", prefix, suffix); \ - err_check_true(stat(fn, &st), 0); \ + err_check_true(stat(fn, &st), 0, fn); \ fp = xopen(fn, "r"); \ data = (uint8_t*)malloc(st.st_size); \ err_fread_noeof(data, 1, st.st_size, fp); \ diff --git a/share_mem.c b/share_mem.c index 1fe07fe..b256da7 100644 --- a/share_mem.c +++ b/share_mem.c @@ -45,7 +45,7 @@ int shm_keep_hyb(const char* idx_prefix) { perror("shm_open()"); \ return -1; \ } \ - err_check_true(stat(full_path, &st), 0); \ + err_check_true(stat(full_path, &st), 0, full_path); \ if (ftruncate(shmid, st.st_size) < 0) \ return -1; \ idx_name_len = 8 + strlen(file_name) + 1; \ diff --git a/share_mem.h b/share_mem.h index 6265b66..2727bcb 100644 --- a/share_mem.h +++ b/share_mem.h @@ -2,7 +2,7 @@ #include "utils.h" -#if 0 +#if 1 #define HYB_PAC_SUFFIX ".hyb.pac" #define HYB_SA_SUFFIX ".hyb.bytesa" #define HYB_KMER_SUFFIX ".hyb.kmer" diff --git a/utils.h b/utils.h index c1f2d7e..ee236ed 100644 --- a/utils.h +++ b/utils.h @@ -81,9 +81,9 @@ #endif #endif -#define err_check_true(ret_code, right_val) \ +#define err_check_true(ret_code, right_val, err_str) \ if ((ret_code) != (right_val)) \ - err_fatal("err_check", "Value not right: True-Val %d\n", right_val) + err_fatal("err_check", "Value not right: True-Val %d\n%s\n", right_val, err_str) #define err_check_false(ret_code, err_val) \ if ((ret_code) == (err_val)) \ @@ -93,7 +93,7 @@ do { \ FILE* fp = NULL; \ struct stat st; \ - err_check_true(stat(fn, &st), 0); \ + err_check_true(stat(fn, &st), 0, fn); \ fp = xopen(fn, "r"); \ data = (uint8_t*)malloc(st.st_size); \ err_fread_noeof(data, 1, st.st_size, fp); \