From f8eecef184c8684a3ed27712ccf8f7f866d47c40 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sun, 14 Feb 2016 13:31:59 +0100 Subject: Reduce `ChangeTracker` public _interface_ to `track` --- src/change_log.cc | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/change_log.cc') diff --git a/src/change_log.cc b/src/change_log.cc index ae28079..a00a26f 100644 --- a/src/change_log.cc +++ b/src/change_log.cc @@ -42,20 +42,14 @@ void init() { inline void track_write(const int fd) { if ( enabled && fd != *fd_guard && utility::is_regular_file(fd) ) { - const std::string file_name{ utility::get_file_name(fd) }; - - if ( !tracker->is_tracked(file_name) ) { - tracker->track(file_name); - } + tracker->track(utility::get_file_path(fd)); } } inline void track_rename( const std::string& old_path, const std::string& new_path) { if ( enabled ) { - if ( !tracker->is_tracked(old_path) ) { - tracker->track(old_path); - } + tracker->track(old_path); logger->append("renamed '", old_path, "' to '", new_path, "'"); } @@ -109,7 +103,7 @@ int unlinkat(int dirfd, const char* path, int flags) { if ( dirfd == AT_FDCWD ) { track_remove(path); } else { - track_remove(utility::get_file_name(dirfd) + path); + track_remove(utility::get_file_path(dirfd) + path); } return actual::unlinkat(dirfd, path, flags); -- cgit v1.2.3