aboutsummaryrefslogtreecommitdiff
path: root/src/change_log.cc
diff options
context:
space:
mode:
authorAdrian Kummerlaender2016-02-14 13:31:59 +0100
committerAdrian Kummerlaender2016-02-14 13:31:59 +0100
commitf8eecef184c8684a3ed27712ccf8f7f866d47c40 (patch)
tree7f74badacd65fdd23afcdbebc1985e92ea06193a /src/change_log.cc
parent055bd52fd88f49b8aef4da4b7b7c6b38cb1f7e3e (diff)
downloadchange-f8eecef184c8684a3ed27712ccf8f7f866d47c40.tar
change-f8eecef184c8684a3ed27712ccf8f7f866d47c40.tar.gz
change-f8eecef184c8684a3ed27712ccf8f7f866d47c40.tar.bz2
change-f8eecef184c8684a3ed27712ccf8f7f866d47c40.tar.lz
change-f8eecef184c8684a3ed27712ccf8f7f866d47c40.tar.xz
change-f8eecef184c8684a3ed27712ccf8f7f866d47c40.tar.zst
change-f8eecef184c8684a3ed27712ccf8f7f866d47c40.zip
Reduce `ChangeTracker` public _interface_ to `track`
Diffstat (limited to 'src/change_log.cc')
-rw-r--r--src/change_log.cc12
1 files changed, 3 insertions, 9 deletions
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);