OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium 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 "update_engine/filesystem_copier_action.h" | 5 #include "update_engine/filesystem_copier_action.h" |
6 #include <sys/stat.h> | 6 #include <sys/stat.h> |
7 #include <sys/types.h> | 7 #include <sys/types.h> |
8 #include <errno.h> | 8 #include <errno.h> |
9 #include <fcntl.h> | 9 #include <fcntl.h> |
10 #include <stdlib.h> | 10 #include <stdlib.h> |
(...skipping 25 matching lines...) Expand all Loading... |
36 ScopedActionCompleter abort_action_completer(processor_, this); | 36 ScopedActionCompleter abort_action_completer(processor_, this); |
37 | 37 |
38 if (!HasInputObject()) { | 38 if (!HasInputObject()) { |
39 LOG(ERROR) << "FilesystemCopierAction missing input object."; | 39 LOG(ERROR) << "FilesystemCopierAction missing input object."; |
40 return; | 40 return; |
41 } | 41 } |
42 install_plan_ = GetInputObject(); | 42 install_plan_ = GetInputObject(); |
43 | 43 |
44 if (install_plan_.is_full_update) { | 44 if (install_plan_.is_full_update) { |
45 // No copy needed. Done! | 45 // No copy needed. Done! |
| 46 if (HasOutputPipe()) |
| 47 SetOutputObject(install_plan_); |
46 abort_action_completer.set_success(true); | 48 abort_action_completer.set_success(true); |
47 return; | 49 return; |
48 } | 50 } |
49 | 51 |
50 string source = copy_source_; | 52 string source = copy_source_; |
51 if (source.empty()) { | 53 if (source.empty()) { |
52 source = copying_kernel_install_path_ ? | 54 source = copying_kernel_install_path_ ? |
53 utils::BootKernelDevice(utils::BootDevice()) : | 55 utils::BootKernelDevice(utils::BootDevice()) : |
54 utils::BootDevice(); | 56 utils::BootDevice(); |
55 } | 57 } |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 src_stream_, | 170 src_stream_, |
169 &buffer_[0], | 171 &buffer_[0], |
170 buffer_.size(), | 172 buffer_.size(), |
171 G_PRIORITY_DEFAULT, | 173 G_PRIORITY_DEFAULT, |
172 canceller_, | 174 canceller_, |
173 &FilesystemCopierAction::StaticAsyncReadyCallback, | 175 &FilesystemCopierAction::StaticAsyncReadyCallback, |
174 this); | 176 this); |
175 } | 177 } |
176 | 178 |
177 } // namespace chromeos_update_engine | 179 } // namespace chromeos_update_engine |
OLD | NEW |