diff --git a/liblrzip_demo.c b/liblrzip_demo.c index 83d30c9..76e4d21 100644 --- a/liblrzip_demo.c +++ b/liblrzip_demo.c @@ -11,11 +11,11 @@ #ifdef HAVE_ERRNO_H # include #else +extern int errno; +#endif #ifdef HAVE_UNISTD_H # include #endif -extern int errno; -#endif #include #include diff --git a/lrzip.c b/lrzip.c index 34075b4..1820297 100644 --- a/lrzip.c +++ b/lrzip.c @@ -276,6 +276,7 @@ bool preserve_perms(rzip_control *control, int fd_in, int fd_out) /* chown fail is not fatal_return(( */ if (unlikely(fchown(fd_out, st.st_uid, st.st_gid))) print_verbose("Warning, unable to set owner on %s\n", control->outfile); + return true; } /* Open a temporary outputfile to emulate stdout */ diff --git a/lrzip.h b/lrzip.h index a2b1e0f..d793776 100644 --- a/lrzip.h +++ b/lrzip.h @@ -25,7 +25,7 @@ inline i64 get_ram(rzip_control *control); i64 nloops(i64 seconds, uchar *b1, uchar *b2); bool write_magic(rzip_control *control); bool read_magic(rzip_control *control, int fd_in, i64 *expected_size); -void preserve_perms(rzip_control *control, int fd_in, int fd_out); +bool preserve_perms(rzip_control *control, int fd_in, int fd_out); int open_tmpoutfile(rzip_control *control); bool dump_tmpoutfile(rzip_control *control, int fd_out); int open_tmpinfile(rzip_control *control); diff --git a/runzip.c b/runzip.c index 1c2469d..452077a 100644 --- a/runzip.c +++ b/runzip.c @@ -314,7 +314,7 @@ static i64 runzip_chunk(rzip_control *control, int fd_in, i64 expected_size, i64 case 0: u = unzip_literal(control, ss, len, &cksum); if (unlikely(u == -1)) { - close_stream_in(ss); + close_stream_in(control, ss); return -1; } total += u; @@ -323,7 +323,7 @@ static i64 runzip_chunk(rzip_control *control, int fd_in, i64 expected_size, i64 default: u = unzip_match(control, ss, len, &cksum, chunk_bytes); if (unlikely(u == -1)) { - close_stream_in(ss); + close_stream_in(control, ss); return -1; } total += u; @@ -343,11 +343,11 @@ static i64 runzip_chunk(rzip_control *control, int fd_in, i64 expected_size, i64 if (!HAS_MD5) { good_cksum = read_u32(control, ss, 0, &err); if (unlikely(err)) { - close_stream_in(ss); + close_stream_in(control, ss); return -1; } if (unlikely(good_cksum != cksum)) { - close_stream_in(ss); + close_stream_in(control, ss); failure_return(("Bad checksum: 0x%08x - expected: 0x%08x\n", cksum, good_cksum), -1); } print_maxverbose("Checksum for block: 0x%08x\n", cksum); diff --git a/stream.h b/stream.h index bb089d2..abf00c5 100644 --- a/stream.h +++ b/stream.h @@ -29,8 +29,8 @@ bool join_pthread(pthread_t th, void **thread_return); ssize_t write_1g(rzip_control *control, void *buf, i64 len); ssize_t read_1g(rzip_control *control, int fd, void *buf, i64 len); i64 get_readseek(rzip_control *control, int fd); -void prepare_streamout_threads(rzip_control *control); -void close_streamout_threads(rzip_control *control); +bool prepare_streamout_threads(rzip_control *control); +bool close_streamout_threads(rzip_control *control); void *open_stream_out(rzip_control *control, int f, unsigned int n, i64 chunk_limit, char cbytes); void *open_stream_in(rzip_control *control, int f, int n, char cbytes); bool flush_buffer(rzip_control *control, struct stream_info *sinfo, int stream);