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

Side by Side Diff: generate_delta_main.cc

Issue 3620013: AU: Resume interrupted update attempts. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: fix setup download Created 10 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « filesystem_copier_action_unittest.cc ('k') | multi_http_fetcher.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <sys/types.h> 5 #include <sys/types.h>
6 #include <sys/stat.h> 6 #include <sys/stat.h>
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <unistd.h> 9 #include <unistd.h>
10 10
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 CHECK_GE(fd, 0); 84 CHECK_GE(fd, 0);
85 ScopedFdCloser fd_closer(&fd); 85 ScopedFdCloser fd_closer(&fd);
86 for (off_t offset = 0;; offset += buf.size()) { 86 for (off_t offset = 0;; offset += buf.size()) {
87 ssize_t bytes_read; 87 ssize_t bytes_read;
88 CHECK(utils::PReadAll(fd, &buf[0], buf.size(), offset, &bytes_read)); 88 CHECK(utils::PReadAll(fd, &buf[0], buf.size(), offset, &bytes_read));
89 if (bytes_read == 0) 89 if (bytes_read == 0)
90 break; 90 break;
91 CHECK_EQ(performer.Write(&buf[0], bytes_read), bytes_read); 91 CHECK_EQ(performer.Write(&buf[0], bytes_read), bytes_read);
92 } 92 }
93 CHECK_EQ(performer.Close(), 0); 93 CHECK_EQ(performer.Close(), 0);
94 DeltaPerformer::ResetUpdateProgress(&prefs, false);
94 LOG(INFO) << "done applying delta."; 95 LOG(INFO) << "done applying delta.";
95 return 0; 96 return 0;
96 } 97 }
97 CHECK(!FLAGS_new_image.empty()); 98 CHECK(!FLAGS_new_image.empty());
98 CHECK(!FLAGS_out_file.empty()); 99 CHECK(!FLAGS_out_file.empty());
99 CHECK(!FLAGS_new_kernel.empty()); 100 CHECK(!FLAGS_new_kernel.empty());
100 if (FLAGS_old_image.empty()) { 101 if (FLAGS_old_image.empty()) {
101 LOG(INFO) << "Generating full update"; 102 LOG(INFO) << "Generating full update";
102 } else { 103 } else {
103 LOG(INFO) << "Generating delta update"; 104 LOG(INFO) << "Generating delta update";
(...skipping 16 matching lines...) Expand all
120 return 0; 121 return 0;
121 } 122 }
122 123
123 } // namespace {} 124 } // namespace {}
124 125
125 } // namespace chromeos_update_engine 126 } // namespace chromeos_update_engine
126 127
127 int main(int argc, char** argv) { 128 int main(int argc, char** argv) {
128 return chromeos_update_engine::Main(argc, argv); 129 return chromeos_update_engine::Main(argc, argv);
129 } 130 }
OLDNEW
« no previous file with comments | « filesystem_copier_action_unittest.cc ('k') | multi_http_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698