~ubuntu-branches/debian/stretch/tabix/stretch

« back to all changes in this revision

Viewing changes to bgzip.c

  • Committer: Package Import Robot
  • Author(s): Charles Plessy
  • Date: 2012-06-22 13:14:27 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20120622131427-538ff7c4fn6xtbj4
Tags: 0.2.6-1
60eb374 Imported Upstream version 0.2.6
9de2ad5 Removed patches applied or obsoleted upstream.
2836b51 Refreshed hardening patch.
7677e45 Regression tests for autopkgtest.

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
 
73
73
static void fail(BGZF* fp)
74
74
{
75
 
    fprintf(stderr, "Error: %s\n", fp->error);
 
75
    fprintf(stderr, "Error: %d\n", fp->errcode);
76
76
    exit(1);
77
77
}
78
78
 
132
132
                else if (!pstdout && isatty(fileno((FILE *)stdout)) )
133
133
                        return bgzip_main_usage();
134
134
 
135
 
                fp = bgzf_fdopen(f_dst, "w");
 
135
                fp = bgzf_dopen(f_dst, "w");
136
136
                buffer = malloc(WINDOW_SIZE);
137
137
                while ((c = read(f_src, buffer, WINDOW_SIZE)) > 0)
138
138
                        if (bgzf_write(fp, buffer, c) < 0) fail(fp);
181
181
                else
182
182
                {
183
183
                        f_dst = fileno(stdout);
184
 
                        fp = bgzf_fdopen(fileno(stdin), "r");
 
184
                        fp = bgzf_dopen(fileno(stdin), "r");
185
185
                        if (fp == NULL) {
186
186
                                fprintf(stderr, "[bgzip] Could not read from stdin: %s\n", strerror(errno));
187
187
                                return 1;