From 1d9f410810de6fbb9c974735e5e14dbebe1c0718 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 22 Jul 2016 12:43:22 +0300 Subject: Adapt to fdstream extension --- bpkg/pkg-verify.cxx | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) (limited to 'bpkg/pkg-verify.cxx') diff --git a/bpkg/pkg-verify.cxx b/bpkg/pkg-verify.cxx index 3c79cbd..ea072d9 100644 --- a/bpkg/pkg-verify.cxx +++ b/bpkg/pkg-verify.cxx @@ -4,8 +4,6 @@ #include -#include - #include #include @@ -38,11 +36,9 @@ namespace bpkg // process pr (start_extract (co, af, mf, diag)); - ifdstream is (pr.in_ofd); - is.exceptions (ifdstream::badbit | ifdstream::failbit); - try { + ifdstream is (pr.in_ofd, fdstream_mode::skip); manifest_parser mp (is, mf.string ()); package_manifest m (mp, iu); is.close (); @@ -73,15 +69,6 @@ namespace bpkg // catch (const manifest_parsing& e) { - // Before we used to just close the file descriptor to signal to the - // other end that we are not interested in the rest. But tar doesn't - // take this very well (SIGPIPE). So now we are going to skip until - // the end. - // - if (!is.eof ()) - is.ignore (numeric_limits::max ()); - is.close (); - if (pr.wait ()) { if (diag) @@ -93,8 +80,6 @@ namespace bpkg } catch (const ifdstream::failure&) { - is.close (); - if (pr.wait ()) { if (diag) @@ -144,10 +129,7 @@ namespace bpkg try { - ifstream ifs; - ifs.exceptions (ifstream::badbit | ifstream::failbit); - ifs.open (mf.string ()); - + ifdstream ifs (mf); manifest_parser mp (ifs, mf.string ()); package_manifest m (mp, iu); @@ -175,10 +157,10 @@ namespace bpkg throw failed (); } - catch (const ifstream::failure&) + catch (const ifdstream::failure& e) { if (diag) - error << "unable to read from " << mf; + error << "unable to read from " << mf << ": " << e.what (); throw failed (); } -- cgit v1.1