aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/gzip/unxz.c
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2017-11-21 08:14:30 +0000
committerXin LI <delphij@FreeBSD.org>2017-11-21 08:14:30 +0000
commit90f528e8d7868a5d31dc35b24943c673bf67821d (patch)
tree8cb4613b1f6062902779baf89fa3c4b69d6437f6 /usr.bin/gzip/unxz.c
parentc0a0f12f9b7c596f08ab58fe4d42b7c75741da3e (diff)
downloadsrc-90f528e8d7868a5d31dc35b24943c673bf67821d.tar.gz
src-90f528e8d7868a5d31dc35b24943c673bf67821d.zip
Support SIGINFO.
Obtained from: NetBSD MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=326052
Diffstat (limited to 'usr.bin/gzip/unxz.c')
-rw-r--r--usr.bin/gzip/unxz.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/gzip/unxz.c b/usr.bin/gzip/unxz.c
index 0d20fa353259..6b01485160b4 100644
--- a/usr.bin/gzip/unxz.c
+++ b/usr.bin/gzip/unxz.c
@@ -1,4 +1,4 @@
-/* $NetBSD: unxz.c,v 1.6 2016/01/29 15:19:01 christos Exp $ */
+/* $NetBSD: unxz.c,v 1.7 2017/08/04 07:27:08 mrg Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -56,6 +56,7 @@ unxz(int i, int o, char *pre, size_t prelen, off_t *bytes_in)
strm.avail_in = read(i, ibuf + prelen, sizeof(ibuf) - prelen);
if (strm.avail_in == (size_t)-1)
maybe_err("read failed");
+ infile_newdata(strm.avail_in);
strm.avail_in += prelen;
*bytes_in = strm.avail_in;
@@ -72,6 +73,7 @@ unxz(int i, int o, char *pre, size_t prelen, off_t *bytes_in)
strm.avail_out = sizeof(obuf);
for (;;) {
+ check_siginfo();
if (strm.avail_in == 0) {
strm.next_in = ibuf;
strm.avail_in = read(i, ibuf, sizeof(ibuf));
@@ -83,6 +85,7 @@ unxz(int i, int o, char *pre, size_t prelen, off_t *bytes_in)
action = LZMA_FINISH;
break;
default:
+ infile_newdata(strm.avail_in);
*bytes_in += strm.avail_in;
break;
}