| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 | 86 |
| 87 void FilesystemCopierAction::TerminateProcessing() { | 87 void FilesystemCopierAction::TerminateProcessing() { |
| 88 if (is_mounted_) { | 88 if (is_mounted_) { |
| 89 LOG(ERROR) << "Aborted processing, but left a filesystem mounted."; | 89 LOG(ERROR) << "Aborted processing, but left a filesystem mounted."; |
| 90 } | 90 } |
| 91 } | 91 } |
| 92 | 92 |
| 93 bool FilesystemCopierAction::Mount(const string& device, | 93 bool FilesystemCopierAction::Mount(const string& device, |
| 94 const string& mountpoint) { | 94 const string& mountpoint) { |
| 95 CHECK(!is_mounted_); | 95 CHECK(!is_mounted_); |
| 96 if(utils::MountFilesystem(device, mountpoint)) | 96 if(utils::MountFilesystem(device, mountpoint, 0)) |
| 97 is_mounted_ = true; | 97 is_mounted_ = true; |
| 98 return is_mounted_; | 98 return is_mounted_; |
| 99 } | 99 } |
| 100 | 100 |
| 101 bool FilesystemCopierAction::Unmount(const string& mountpoint) { | 101 bool FilesystemCopierAction::Unmount(const string& mountpoint) { |
| 102 CHECK(is_mounted_); | 102 CHECK(is_mounted_); |
| 103 if (utils::UnmountFilesystem(mountpoint)) | 103 if (utils::UnmountFilesystem(mountpoint)) |
| 104 is_mounted_ = false; | 104 is_mounted_ = false; |
| 105 return !is_mounted_; | 105 return !is_mounted_; |
| 106 } | 106 } |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 } | 298 } |
| 299 TEST_AND_RETURN_FALSE(!iter.IsErr()); | 299 TEST_AND_RETURN_FALSE(!iter.IsErr()); |
| 300 // Success! | 300 // Success! |
| 301 return true; | 301 return true; |
| 302 } | 302 } |
| 303 | 303 |
| 304 const char* FilesystemCopierAction::kCompleteFilesystemMarker( | 304 const char* FilesystemCopierAction::kCompleteFilesystemMarker( |
| 305 "/update_engine_copy_success"); | 305 "/update_engine_copy_success"); |
| 306 | 306 |
| 307 } // namespace chromeos_update_engine | 307 } // namespace chromeos_update_engine |
| OLD | NEW |