e63e8e4ebaba9f43a6a65f02ee13adf32d7f287b kent Thu Jul 25 13:19:47 2013 -0700 Made it so linefile on gzipped files doesn't abort with an error message if you close it before reading it all. diff --git src/lib/linefile.c src/lib/linefile.c index fda30d8..d53e7b1 100644 --- src/lib/linefile.c +++ src/lib/linefile.c @@ -637,33 +637,35 @@ } void lineFileNeedNext(struct lineFile *lf, char **retStart, int *retSize) /* Fetch next line from file. Squawk and die if it's not there. */ { if (!lineFileNext(lf, retStart, retSize)) lineFileUnexpectedEnd(lf); } void lineFileClose(struct lineFile **pLf) /* Close up a line file. */ { struct lineFile *lf; if ((lf = *pLf) != NULL) { - if (lf->pl != NULL) + struct pipeline *pl = lf->pl; + if (pl != NULL) { - pipelineWait(lf->pl); + pipelineSetNoAbort(pl); + pipelineWait(pl); pipelineFree(&lf->pl); } else if (lf->fd > 0 && lf->fd != fileno(stdin)) { close(lf->fd); freeMem(lf->buf); } #ifdef USE_TABIX else if (lf->tabix != NULL) { if (lf->tabixIter != NULL) ti_iter_destroy(lf->tabixIter); ti_close(lf->tabix); } #endif // USE_TABIX