Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Rdutil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -544,8 +544,12 @@ Rdutil::fillwithbytes(enum Fileinfo::readtobuffermode type,
enum Fileinfo::readtobuffermode lasttype,
const long nsecsleep,
const std::size_t buffersize,
std::function<void(std::size_t)> progress_cb)
std::function<std::function<void(std::size_t)>(void)> progress_cb_f)
{
std::function<void(std::size_t)> progress_cb;
if (progress_cb_f) {
progress_cb = progress_cb_f();
}
// first sort on inode (to read efficiently from the hard drive)
sortOnDeviceAndInode();

Expand Down
2 changes: 1 addition & 1 deletion Rdutil.hh
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public:
enum Fileinfo::readtobuffermode lasttype,
long nsecsleep,
std::size_t buffersize,
std::function<void(std::size_t)> progress_cb);
std::function<std::function<void(std::size_t)>(void)> progress_cb_f);

/// make symlinks of duplicates.
std::size_t makesymlinks(bool dryrun) const;
Expand Down
4 changes: 2 additions & 2 deletions rdfind.cc
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ main(int narg, const char* argv[])
"xxh128 checksum");
}

std::function<void(std::size_t)> progress_callback;
std::function<std::function<void(std::size_t)>(void)> progress_callback;
if (o.showprogress) {
progress_callback = []() {
// format the total count only once, not each iteration.
Expand All @@ -426,7 +426,7 @@ main(int narg, const char* argv[])
<< "\033[s\033[K" // Save the cursor position & clear following text
<< "(" << completed << suffix << std::flush;
};
}();
};
}

for (auto it = modes.begin() + 1; it != modes.end(); ++it) {
Expand Down