| 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/utils.h" | 5 #include "update_engine/utils.h" |
| 6 #include <sys/mount.h> | 6 #include <sys/mount.h> |
| 7 #include <sys/stat.h> | 7 #include <sys/stat.h> |
| 8 #include <sys/types.h> | 8 #include <sys/types.h> |
| 9 #include <dirent.h> | 9 #include <dirent.h> |
| 10 #include <errno.h> | 10 #include <errno.h> |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 return false; | 326 return false; |
| 327 } | 327 } |
| 328 return true; | 328 return true; |
| 329 } | 329 } |
| 330 | 330 |
| 331 bool UnmountFilesystem(const string& mountpoint) { | 331 bool UnmountFilesystem(const string& mountpoint) { |
| 332 TEST_AND_RETURN_FALSE_ERRNO(umount(mountpoint.c_str()) == 0); | 332 TEST_AND_RETURN_FALSE_ERRNO(umount(mountpoint.c_str()) == 0); |
| 333 return true; | 333 return true; |
| 334 } | 334 } |
| 335 | 335 |
| 336 const char* GetGErrorMessage(const GError* error) { |
| 337 if (!error) |
| 338 return "Unknown error."; |
| 339 return error->message; |
| 340 } |
| 341 |
| 336 const char* const kStatefulPartition = "/mnt/stateful_partition"; | 342 const char* const kStatefulPartition = "/mnt/stateful_partition"; |
| 337 | 343 |
| 338 } // namespace utils | 344 } // namespace utils |
| 339 | 345 |
| 340 } // namespace chromeos_update_engine | 346 } // namespace chromeos_update_engine |
| 341 | 347 |
| OLD | NEW |