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

Unified Diff: src/platform/update_engine/install_action.cc

Issue 492008: AU: Try delta updates first, then full updates (Closed)
Patch Set: use mkstemp Created 11 years 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
Index: src/platform/update_engine/install_action.cc
diff --git a/src/platform/update_engine/install_action.cc b/src/platform/update_engine/install_action.cc
index c70867ecdfccb41996d4b977e80865af2000023a..d144b7bbd36ae2b3acc6bba853a2a083153c3661 100644
--- a/src/platform/update_engine/install_action.cc
+++ b/src/platform/update_engine/install_action.cc
@@ -4,6 +4,7 @@
#include "update_engine/install_action.h"
#include <errno.h>
+#include <string>
#include <vector>
#include <gflags/gflags.h>
#include "update_engine/filesystem_iterator.h"
@@ -15,6 +16,7 @@ DEFINE_string(mount_install_path, "",
"If set, the path to use when mounting the "
"destination device during install");
+using std::string;
using std::vector;
namespace chromeos_update_engine {
@@ -124,12 +126,12 @@ bool InstallAction::InstallFile(const std::string& mountpoint,
}
// chmod/chown new file
- if (!S_ISLNK(file.mode()))
- TEST_AND_RETURN_FALSE_ERRNO(chmod((mountpoint + path).c_str(), file.mode())
- == 0);
TEST_AND_RETURN_FALSE(file.has_uid() && file.has_gid());
TEST_AND_RETURN_FALSE_ERRNO(lchown((mountpoint + path).c_str(),
file.uid(), file.gid()) == 0);
+ if (!S_ISLNK(file.mode()))
+ TEST_AND_RETURN_FALSE_ERRNO(chmod((mountpoint + path).c_str(), file.mode())
+ == 0);
return true;
}
« no previous file with comments | « src/platform/update_engine/generate_delta_main.cc ('k') | src/platform/update_engine/install_action_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698