aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/archive.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/archive.cc')
-rw-r--r--src/libutil/archive.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libutil/archive.cc b/src/libutil/archive.cc
index 90a039164..2b8fb2f10 100644
--- a/src/libutil/archive.cc
+++ b/src/libutil/archive.cc
@@ -83,6 +83,7 @@ static void dumpContents(const Path & path, unsigned int size,
unsigned int total = 0;
ssize_t n;
while ((n = read(fd, buf, sizeof(buf)))) {
+ checkInterrupt();
if (n == -1) throw SysError("reading file " + path);
total += n;
sink(buf, n);
@@ -200,6 +201,8 @@ static void restoreEntry(const Path & path, RestoreSource & source)
if (s != "(") throw badArchive("expected open tag");
while (1) {
+ checkInterrupt();
+
s = readString(source);
if (s == ")") {
@@ -224,6 +227,7 @@ static void restoreContents(int fd, const Path & path, RestoreSource & source)
unsigned char buf[65536];
while (left) {
+ checkInterrupt();
unsigned int n = sizeof(buf);
if (n > left) n = left;
source(buf, n);
@@ -247,6 +251,8 @@ static void restore(const Path & path, RestoreSource & source)
AutoCloseFD fd;
while (1) {
+ checkInterrupt();
+
s = readString(source);
if (s == ")") {