From: Ondrej Kozina Date: Mon, 4 Feb 2013 17:23:30 +0000 (+0100) Subject: - fix experimental xa_diff() method X-Git-Tag: v0.1.3~18^2~36 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=af1784871a0d5e80eb32ca06bb718e3590621c72;p=thirdparty%2Fsnapper.git - fix experimental xa_diff() method --- diff --git a/client/snapper.cc b/client/snapper.cc index c18bb173..ee7630ca 100644 --- a/client/snapper.cc +++ b/client/snapper.cc @@ -835,22 +835,18 @@ help_diff() } // TODO: ifdef -ostream& +void xa_diff(ostream &out, const string &loc_pre, const string &loc_post) { int src_fd = open(loc_pre.c_str(), O_RDONLY | O_NOATIME | O_NOFOLLOW); if (src_fd < 0) - { cerr << "Can't open " << loc_pre << stringerror(errno) << endl; - return out; - } int dest_fd = open(loc_post.c_str(), O_RDONLY | O_NOATIME | O_NOFOLLOW); if (dest_fd < 0) { close(src_fd); cerr << "Can't open " << loc_post << stringerror(errno) << endl; - return out; } try { @@ -859,8 +855,6 @@ xa_diff(ostream &out, const string &loc_pre, const string &loc_post) out << "xa_diff" << endl << "--- " << loc_pre << endl << "+++ " << loc_post << endl << xa_mod; } catch (XAttributesException xae) {} - - return out; } // TODO: endif @@ -887,7 +881,7 @@ command_diff(DBus::Connection& conn) { // TODO: #ifdef if (it1->getPreToPostStatus() & XATTRS) - cout << xa_diff(cout, it1->getAbsolutePath(LOC_PRE), it1->getAbsolutePath(LOC_POST)); + xa_diff(cout, it1->getAbsolutePath(LOC_PRE), it1->getAbsolutePath(LOC_POST)); // TODO: #endif SystemCmd cmd(DIFFBIN " --unified --new-file " + quote(it1->getAbsolutePath(LOC_PRE)) +