X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=pysam.git;a=blobdiff_plain;f=tabix%2Fbgzip.c.pysam.c;fp=tabix%2Fbgzip.c.pysam.c;h=bb8e906a936ee82d7564ce374096e02a227e5ab2;hp=55e7029ed9f99d932c50e3938ac0e262b84d0517;hb=920cc77ed26707a0d92f9e436121b61d84bde627;hpb=8ab946e230447a6fe686edabc5e3cfa445da1721 diff --git a/tabix/bgzip.c.pysam.c b/tabix/bgzip.c.pysam.c index 55e7029..bb8e906 100644 --- a/tabix/bgzip.c.pysam.c +++ b/tabix/bgzip.c.pysam.c @@ -74,7 +74,7 @@ static int write_open(const char *fn, int is_forced) static void fail(BGZF* fp) { - fprintf(pysamerr, "Error: %s\n", fp->error); + fprintf(pysamerr, "Error: %d\n", fp->errcode); exit(1); } @@ -134,7 +134,7 @@ int main(int argc, char **argv) else if (!pstdout && isatty(fileno((FILE *)stdout)) ) return bgzip_main_usage(); - fp = bgzf_fdopen(f_dst, "w"); + fp = bgzf_dopen(f_dst, "w"); buffer = malloc(WINDOW_SIZE); while ((c = read(f_src, buffer, WINDOW_SIZE)) > 0) if (bgzf_write(fp, buffer, c) < 0) fail(fp); @@ -183,7 +183,7 @@ int main(int argc, char **argv) else { f_dst = fileno(stdout); - fp = bgzf_fdopen(fileno(stdin), "r"); + fp = bgzf_dopen(fileno(stdin), "r"); if (fp == NULL) { fprintf(pysamerr, "[bgzip] Could not read from stdin: %s\n", strerror(errno)); return 1;