diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2010-08-26 14:49:04 -0700 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2010-08-26 14:49:04 -0700 |
commit | 80459cf8380301800e4d024a5eb2bc4a63cdd919 (patch) | |
tree | 9d1faa8fbc66be10dcaf0f36c3a3f4db603dab5e /src/cstore/unionfs/cstore-unionfs.cpp | |
parent | e2e8e49c2a801d1afc87dd376b28f046374c26fd (diff) | |
download | vyatta-cfg-80459cf8380301800e4d024a5eb2bc4a63cdd919.tar.gz vyatta-cfg-80459cf8380301800e4d024a5eb2bc4a63cdd919.zip |
mark changed ancestors up to the root
Diffstat (limited to 'src/cstore/unionfs/cstore-unionfs.cpp')
-rw-r--r-- | src/cstore/unionfs/cstore-unionfs.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/cstore/unionfs/cstore-unionfs.cpp b/src/cstore/unionfs/cstore-unionfs.cpp index 849d659..eebabfe 100644 --- a/src/cstore/unionfs/cstore-unionfs.cpp +++ b/src/cstore/unionfs/cstore-unionfs.cpp @@ -755,9 +755,15 @@ bool UnionfsCstore::mark_changed_with_ancestors() { b_fs::path opath = mutable_cfg_path; // use a copy - while (opath.has_parent_path()) { - b_fs::path marker = (work_root / opath); - pop_path(opath); + bool done = false; + while (!done) { + b_fs::path marker = work_root; + if (opath.has_parent_path()) { + marker /= opath; + pop_path(opath); + } else { + done = true; + } if (!b_fs_exists(marker) || !b_fs_is_directory(marker)) { // don't do anything if the node is not there continue; |