| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |