diff --git a/rar2fs.c b/rar2fs.c index 7d09f55..4e88a64 100644 --- a/rar2fs.c +++ b/rar2fs.c @@ -1481,8 +1481,9 @@ check_idx: * Early reads at offsets reaching the last few percent of the * file is most likely a request for index information. */ - } else if ((((offset - op->pos) / (op->entry_p->stat.st_size * 1.0) * 100) > 95.0 && - op->seq < 10)) { + } else if ((((offset - op->pos) / (op->entry_p->stat.st_size * 1.0) * 100) > 95.0 + && op->seq < 10 + && ((offset + size) - op->buf->offset) > (IOB_SZ - IOB_HIST_SZ))) { printd(3, "seq=%d long jump hack1 offset=%" PRIu64 "," " size=%zu, buf->offset=%" PRIu64 "\n", op->seq, offset, size, @@ -1578,7 +1579,7 @@ check_idx: /* Take control of reader thread */ if (sync_thread_noread(op)) return -EIO; - if (!feof(op->fp) && offset > op->buf->offset) { + while (!feof(op->fp) && offset > op->buf->offset) { /* consume buffer */ op->pos += op->buf->used; op->buf->ri = op->buf->wi; @@ -3860,7 +3861,7 @@ static int rar2_open(const char *path, struct fuse_file_info *fi) * Since the file contents will never change this should save * us from some user space calls! */ -#if 0 /* disable for now (issue #66) */ +#if 1 /* disable for now (issue #66) */ fi->keep_cache = 1; #endif diff --git a/sighandler.c b/sighandler.c index 886d31a..28e568c 100644 --- a/sighandler.c +++ b/sighandler.c @@ -35,6 +35,7 @@ extern void __handle_sigusr1(); extern void __handle_sighup(); +extern void __handle_sigchld(); #ifdef HAVE_STRUCT_SIGACTION_SA_SIGACTION #if !defined ( HAVE_EXECINFO_H ) || !defined ( HAVE_UCONTEXT_H ) @@ -154,7 +155,7 @@ void sighandler_init() { struct sigaction act; -#if 0 +#if 1 /* Avoid child zombies for SIGCHLD */ sigaction(SIGCHLD, NULL, &act); #ifdef HAVE_STRUCT_SIGACTION_SA_SIGACTION