Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(942)

Unified Diff: delta_diff_generator.cc

Issue 6551015: AU: When checking if we've visited a file before, don't follow symlinks. (Closed) Base URL: http://git.chromium.org/git/update_engine.git@master
Patch Set: unittest Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | delta_performer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: delta_diff_generator.cc
diff --git a/delta_diff_generator.cc b/delta_diff_generator.cc
index ccdf27ad5ce56341ccbfde8ac0bc5299a5f0da7a..82bce8a5ca024ab728414e5dfc625370e6aed3a3 100644
--- a/delta_diff_generator.cc
+++ b/delta_diff_generator.cc
@@ -169,11 +169,11 @@ bool DeltaReadFiles(Graph* graph,
// from using a graph/cycle detection/etc to generate diffs, and at that
// time, it will be easy (non-complex) to have many operations read
// from the same source blocks. At that time, this code can die. -adlr
- bool should_diff_from_source = true;
+ bool should_diff_from_source = false;
string src_path = old_root + fs_iter.GetPartialPath();
- if (utils::FileExists(src_path.c_str())) {
- struct stat src_stbuf;
- TEST_AND_RETURN_FALSE_ERRNO(0 == stat(src_path.c_str(), &src_stbuf));
+ struct stat src_stbuf;
+ if (0 == lstat(src_path.c_str(), &src_stbuf) &&
+ S_ISREG(src_stbuf.st_mode)) {
should_diff_from_source = !utils::SetContainsKey(visited_src_inodes,
src_stbuf.st_ino);
visited_src_inodes.insert(src_stbuf.st_ino);
« no previous file with comments | « no previous file | delta_performer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698