The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2007 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Elliott Hughes | 63a3192 | 2016-06-09 17:41:22 -0700 | [diff] [blame] | 17 | #include "roots.h" |
| 18 | |
Tao Bao | bb10e58 | 2017-07-22 16:30:34 -0700 | [diff] [blame] | 19 | #include <ctype.h> |
| 20 | #include <fcntl.h> |
Abhishek Arpure | 4fec8e9 | 2017-08-24 15:27:16 +0530 | [diff] [blame] | 21 | #include <stdint.h> |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 22 | #include <stdlib.h> |
| 23 | #include <sys/mount.h> |
| 24 | #include <sys/stat.h> |
| 25 | #include <sys/types.h> |
JP Abgrall | 37aedb3 | 2014-06-16 19:07:39 -0700 | [diff] [blame] | 26 | #include <sys/wait.h> |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 27 | #include <unistd.h> |
| 28 | |
Tao Bao | 3c00fac | 2017-07-22 16:46:54 -0700 | [diff] [blame] | 29 | #include <algorithm> |
| 30 | #include <string> |
| 31 | #include <vector> |
| 32 | |
Tianjie Xu | 7b0ad9c | 2016-08-05 18:00:04 -0700 | [diff] [blame] | 33 | #include <android-base/logging.h> |
Jin Qian | ded2dac | 2017-04-21 14:36:12 -0700 | [diff] [blame] | 34 | #include <android-base/properties.h> |
| 35 | #include <android-base/stringprintf.h> |
Jin Qian | f3ccad5 | 2017-07-24 10:34:35 -0700 | [diff] [blame] | 36 | #include <android-base/unique_fd.h> |
Tao Bao | bb10e58 | 2017-07-22 16:30:34 -0700 | [diff] [blame] | 37 | #include <cryptfs.h> |
Tao Bao | de40ba5 | 2016-10-05 23:17:01 -0700 | [diff] [blame] | 38 | #include <ext4_utils/wipe.h> |
Ken Sumrall | f35d1ce | 2013-02-13 12:59:35 -0800 | [diff] [blame] | 39 | #include <fs_mgr.h> |
Tao Bao | de40ba5 | 2016-10-05 23:17:01 -0700 | [diff] [blame] | 40 | |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 41 | #include "common.h" |
Elliott Hughes | 63a3192 | 2016-06-09 17:41:22 -0700 | [diff] [blame] | 42 | #include "mounts.h" |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 43 | |
Tao Bao | bb10e58 | 2017-07-22 16:30:34 -0700 | [diff] [blame] | 44 | static struct fstab* fstab = nullptr; |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 45 | |
Tao Bao | bb10e58 | 2017-07-22 16:30:34 -0700 | [diff] [blame] | 46 | extern struct selabel_handle* sehandle; |
Stephen Smalley | 779701d | 2012-02-09 14:13:23 -0500 | [diff] [blame] | 47 | |
Tao Bao | bb10e58 | 2017-07-22 16:30:34 -0700 | [diff] [blame] | 48 | void load_volume_table() { |
| 49 | fstab = fs_mgr_read_fstab_default(); |
| 50 | if (!fstab) { |
| 51 | LOG(ERROR) << "Failed to read default fstab"; |
| 52 | return; |
| 53 | } |
Doug Zongker | 2810ced | 2011-02-17 15:55:21 -0800 | [diff] [blame] | 54 | |
Tao Bao | bb10e58 | 2017-07-22 16:30:34 -0700 | [diff] [blame] | 55 | int ret = fs_mgr_add_entry(fstab, "/tmp", "ramdisk", "ramdisk"); |
| 56 | if (ret == -1) { |
| 57 | LOG(ERROR) << "Failed to add /tmp entry to fstab"; |
| 58 | fs_mgr_free_fstab(fstab); |
| 59 | fstab = nullptr; |
| 60 | return; |
| 61 | } |
Doug Zongker | d4208f9 | 2010-09-20 12:16:13 -0700 | [diff] [blame] | 62 | |
Tao Bao | bb10e58 | 2017-07-22 16:30:34 -0700 | [diff] [blame] | 63 | printf("recovery filesystem table\n"); |
| 64 | printf("=========================\n"); |
| 65 | for (int i = 0; i < fstab->num_entries; ++i) { |
| 66 | const Volume* v = &fstab->recs[i]; |
| 67 | printf(" %d %s %s %s %lld\n", i, v->mount_point, v->fs_type, v->blk_device, v->length); |
| 68 | } |
| 69 | printf("\n"); |
Doug Zongker | d4208f9 | 2010-09-20 12:16:13 -0700 | [diff] [blame] | 70 | } |
| 71 | |
Tao Bao | 2dfc1a3 | 2017-09-27 13:12:11 -0700 | [diff] [blame] | 72 | // Finds the volume specified by the given path. fs_mgr_get_entry_for_mount_point() does exact match |
| 73 | // only, so it attempts the prefixes recursively (e.g. "/cache/recovery/last_log", |
| 74 | // "/cache/recovery", "/cache", "/" for a given path of "/cache/recovery/last_log") and returns the |
| 75 | // first match or nullptr. |
Doug Zongker | d4208f9 | 2010-09-20 12:16:13 -0700 | [diff] [blame] | 76 | Volume* volume_for_path(const char* path) { |
Tao Bao | 2dfc1a3 | 2017-09-27 13:12:11 -0700 | [diff] [blame] | 77 | if (path == nullptr || path[0] == '\0') return nullptr; |
| 78 | std::string str(path); |
| 79 | while (true) { |
| 80 | Volume* result = fs_mgr_get_entry_for_mount_point(fstab, str.c_str()); |
| 81 | if (result != nullptr || str == "/") { |
| 82 | return result; |
| 83 | } |
| 84 | size_t slash = str.find_last_of('/'); |
| 85 | if (slash == std::string::npos) return nullptr; |
| 86 | if (slash == 0) { |
| 87 | str = "/"; |
| 88 | } else { |
| 89 | str = str.substr(0, slash); |
| 90 | } |
| 91 | } |
| 92 | return nullptr; |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 93 | } |
| 94 | |
Tao Bao | abb8f77 | 2015-07-30 14:43:27 -0700 | [diff] [blame] | 95 | // Mount the volume specified by path at the given mount_point. |
| 96 | int ensure_path_mounted_at(const char* path, const char* mount_point) { |
Tao Bao | bb10e58 | 2017-07-22 16:30:34 -0700 | [diff] [blame] | 97 | Volume* v = volume_for_path(path); |
| 98 | if (v == nullptr) { |
| 99 | LOG(ERROR) << "unknown volume for path [" << path << "]"; |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 100 | return -1; |
Tao Bao | bb10e58 | 2017-07-22 16:30:34 -0700 | [diff] [blame] | 101 | } |
| 102 | if (strcmp(v->fs_type, "ramdisk") == 0) { |
| 103 | // The ramdisk is always mounted. |
| 104 | return 0; |
| 105 | } |
| 106 | |
| 107 | if (!scan_mounted_volumes()) { |
| 108 | LOG(ERROR) << "Failed to scan mounted volumes"; |
| 109 | return -1; |
| 110 | } |
| 111 | |
| 112 | if (!mount_point) { |
| 113 | mount_point = v->mount_point; |
| 114 | } |
| 115 | |
| 116 | const MountedVolume* mv = find_mounted_volume_by_mount_point(mount_point); |
| 117 | if (mv != nullptr) { |
| 118 | // Volume is already mounted. |
| 119 | return 0; |
| 120 | } |
| 121 | |
| 122 | mkdir(mount_point, 0755); // in case it doesn't already exist |
| 123 | |
| 124 | if (strcmp(v->fs_type, "ext4") == 0 || strcmp(v->fs_type, "squashfs") == 0 || |
| 125 | strcmp(v->fs_type, "vfat") == 0) { |
| 126 | int result = mount(v->blk_device, mount_point, v->fs_type, v->flags, v->fs_options); |
| 127 | if (result == -1 && fs_mgr_is_formattable(v)) { |
| 128 | PLOG(ERROR) << "Failed to mount " << mount_point << "; formatting"; |
| 129 | bool crypt_footer = fs_mgr_is_encryptable(v) && !strcmp(v->key_loc, "footer"); |
| 130 | if (fs_mgr_do_format(v, crypt_footer) == 0) { |
| 131 | result = mount(v->blk_device, mount_point, v->fs_type, v->flags, v->fs_options); |
| 132 | } else { |
| 133 | PLOG(ERROR) << "Failed to format " << mount_point; |
| 134 | return -1; |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | if (result == -1) { |
| 139 | PLOG(ERROR) << "Failed to mount " << mount_point; |
| 140 | return -1; |
| 141 | } |
| 142 | return 0; |
| 143 | } |
| 144 | |
| 145 | LOG(ERROR) << "unknown fs_type \"" << v->fs_type << "\" for " << mount_point; |
| 146 | return -1; |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 147 | } |
| 148 | |
Tao Bao | abb8f77 | 2015-07-30 14:43:27 -0700 | [diff] [blame] | 149 | int ensure_path_mounted(const char* path) { |
Tao Bao | bb10e58 | 2017-07-22 16:30:34 -0700 | [diff] [blame] | 150 | // Mount at the default mount point. |
| 151 | return ensure_path_mounted_at(path, nullptr); |
Tao Bao | abb8f77 | 2015-07-30 14:43:27 -0700 | [diff] [blame] | 152 | } |
| 153 | |
Doug Zongker | d4208f9 | 2010-09-20 12:16:13 -0700 | [diff] [blame] | 154 | int ensure_path_unmounted(const char* path) { |
Tao Bao | bb10e58 | 2017-07-22 16:30:34 -0700 | [diff] [blame] | 155 | const Volume* v = volume_for_path(path); |
| 156 | if (v == nullptr) { |
| 157 | LOG(ERROR) << "unknown volume for path [" << path << "]"; |
| 158 | return -1; |
| 159 | } |
| 160 | if (strcmp(v->fs_type, "ramdisk") == 0) { |
| 161 | // The ramdisk is always mounted; you can't unmount it. |
| 162 | return -1; |
| 163 | } |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 164 | |
Tao Bao | bb10e58 | 2017-07-22 16:30:34 -0700 | [diff] [blame] | 165 | if (!scan_mounted_volumes()) { |
| 166 | LOG(ERROR) << "Failed to scan mounted volumes"; |
| 167 | return -1; |
| 168 | } |
Doug Zongker | d4208f9 | 2010-09-20 12:16:13 -0700 | [diff] [blame] | 169 | |
Tao Bao | bb10e58 | 2017-07-22 16:30:34 -0700 | [diff] [blame] | 170 | MountedVolume* mv = find_mounted_volume_by_mount_point(v->mount_point); |
| 171 | if (mv == nullptr) { |
| 172 | // Volume is already unmounted. |
| 173 | return 0; |
| 174 | } |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 175 | |
Tao Bao | bb10e58 | 2017-07-22 16:30:34 -0700 | [diff] [blame] | 176 | return unmount_mounted_volume(mv); |
Doug Zongker | d4208f9 | 2010-09-20 12:16:13 -0700 | [diff] [blame] | 177 | } |
| 178 | |
Tao Bao | 3c00fac | 2017-07-22 16:46:54 -0700 | [diff] [blame] | 179 | static int exec_cmd(const std::vector<std::string>& args) { |
| 180 | CHECK_NE(static_cast<size_t>(0), args.size()); |
| 181 | |
| 182 | std::vector<char*> argv(args.size()); |
| 183 | std::transform(args.cbegin(), args.cend(), argv.begin(), |
| 184 | [](const std::string& arg) { return const_cast<char*>(arg.c_str()); }); |
| 185 | argv.push_back(nullptr); |
| 186 | |
| 187 | pid_t child; |
| 188 | if ((child = vfork()) == 0) { |
| 189 | execv(argv[0], argv.data()); |
| 190 | _exit(EXIT_FAILURE); |
| 191 | } |
| 192 | |
| 193 | int status; |
| 194 | waitpid(child, &status, 0); |
| 195 | if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) { |
| 196 | LOG(ERROR) << args[0] << " failed with status " << WEXITSTATUS(status); |
| 197 | } |
| 198 | return WEXITSTATUS(status); |
JP Abgrall | 37aedb3 | 2014-06-16 19:07:39 -0700 | [diff] [blame] | 199 | } |
| 200 | |
Abhishek Arpure | 4fec8e9 | 2017-08-24 15:27:16 +0530 | [diff] [blame] | 201 | static int64_t get_file_size(int fd, uint64_t reserve_len) { |
Jin Qian | f3ccad5 | 2017-07-24 10:34:35 -0700 | [diff] [blame] | 202 | struct stat buf; |
| 203 | int ret = fstat(fd, &buf); |
| 204 | if (ret) return 0; |
| 205 | |
Abhishek Arpure | 4fec8e9 | 2017-08-24 15:27:16 +0530 | [diff] [blame] | 206 | int64_t computed_size; |
Jin Qian | f3ccad5 | 2017-07-24 10:34:35 -0700 | [diff] [blame] | 207 | if (S_ISREG(buf.st_mode)) { |
| 208 | computed_size = buf.st_size - reserve_len; |
| 209 | } else if (S_ISBLK(buf.st_mode)) { |
Abhishek Arpure | 4fec8e9 | 2017-08-24 15:27:16 +0530 | [diff] [blame] | 210 | uint64_t block_device_size = get_block_device_size(fd); |
| 211 | if (block_device_size < reserve_len || |
| 212 | block_device_size > std::numeric_limits<int64_t>::max()) { |
| 213 | computed_size = 0; |
| 214 | } else { |
| 215 | computed_size = block_device_size - reserve_len; |
| 216 | } |
Jin Qian | f3ccad5 | 2017-07-24 10:34:35 -0700 | [diff] [blame] | 217 | } else { |
| 218 | computed_size = 0; |
| 219 | } |
| 220 | |
| 221 | return computed_size; |
| 222 | } |
| 223 | |
Paul Lawrence | d0db337 | 2015-11-05 13:38:40 -0800 | [diff] [blame] | 224 | int format_volume(const char* volume, const char* directory) { |
Tao Bao | 3c00fac | 2017-07-22 16:46:54 -0700 | [diff] [blame] | 225 | const Volume* v = volume_for_path(volume); |
| 226 | if (v == nullptr) { |
| 227 | LOG(ERROR) << "unknown volume \"" << volume << "\""; |
| 228 | return -1; |
| 229 | } |
| 230 | if (strcmp(v->fs_type, "ramdisk") == 0) { |
| 231 | LOG(ERROR) << "can't format_volume \"" << volume << "\""; |
| 232 | return -1; |
| 233 | } |
| 234 | if (strcmp(v->mount_point, volume) != 0) { |
| 235 | LOG(ERROR) << "can't give path \"" << volume << "\" to format_volume"; |
| 236 | return -1; |
| 237 | } |
| 238 | if (ensure_path_unmounted(volume) != 0) { |
| 239 | LOG(ERROR) << "format_volume: Failed to unmount \"" << v->mount_point << "\""; |
| 240 | return -1; |
| 241 | } |
| 242 | if (strcmp(v->fs_type, "ext4") != 0 && strcmp(v->fs_type, "f2fs") != 0) { |
Tianjie Xu | 7b0ad9c | 2016-08-05 18:00:04 -0700 | [diff] [blame] | 243 | LOG(ERROR) << "format_volume: fs_type \"" << v->fs_type << "\" unsupported"; |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 244 | return -1; |
Tao Bao | 3c00fac | 2017-07-22 16:46:54 -0700 | [diff] [blame] | 245 | } |
| 246 | |
| 247 | // If there's a key_loc that looks like a path, it should be a block device for storing encryption |
| 248 | // metadata. Wipe it too. |
| 249 | if (v->key_loc != nullptr && v->key_loc[0] == '/') { |
| 250 | LOG(INFO) << "Wiping " << v->key_loc; |
| 251 | int fd = open(v->key_loc, O_WRONLY | O_CREAT, 0644); |
| 252 | if (fd == -1) { |
| 253 | PLOG(ERROR) << "format_volume: Failed to open " << v->key_loc; |
| 254 | return -1; |
| 255 | } |
| 256 | wipe_block_device(fd, get_file_size(fd)); |
| 257 | close(fd); |
| 258 | } |
| 259 | |
Abhishek Arpure | 4fec8e9 | 2017-08-24 15:27:16 +0530 | [diff] [blame] | 260 | int64_t length = 0; |
Tao Bao | 3c00fac | 2017-07-22 16:46:54 -0700 | [diff] [blame] | 261 | if (v->length != 0) { |
| 262 | length = v->length; |
| 263 | } else if (v->key_loc != nullptr && strcmp(v->key_loc, "footer") == 0) { |
| 264 | android::base::unique_fd fd(open(v->blk_device, O_RDONLY)); |
| 265 | if (fd == -1) { |
Abhishek Arpure | 4fec8e9 | 2017-08-24 15:27:16 +0530 | [diff] [blame] | 266 | PLOG(ERROR) << "format_volume: failed to open " << v->blk_device; |
Tao Bao | 3c00fac | 2017-07-22 16:46:54 -0700 | [diff] [blame] | 267 | return -1; |
| 268 | } |
| 269 | length = get_file_size(fd.get(), CRYPT_FOOTER_OFFSET); |
| 270 | if (length <= 0) { |
| 271 | LOG(ERROR) << "get_file_size: invalid size " << length << " for " << v->blk_device; |
| 272 | return -1; |
| 273 | } |
| 274 | } |
| 275 | |
| 276 | if (strcmp(v->fs_type, "ext4") == 0) { |
| 277 | static constexpr int kBlockSize = 4096; |
| 278 | std::vector<std::string> mke2fs_args = { |
| 279 | "/sbin/mke2fs_static", "-F", "-t", "ext4", "-b", std::to_string(kBlockSize), |
| 280 | }; |
| 281 | |
| 282 | int raid_stride = v->logical_blk_size / kBlockSize; |
| 283 | int raid_stripe_width = v->erase_blk_size / kBlockSize; |
| 284 | // stride should be the max of 8KB and logical block size |
| 285 | if (v->logical_blk_size != 0 && v->logical_blk_size < 8192) { |
| 286 | raid_stride = 8192 / kBlockSize; |
| 287 | } |
| 288 | if (v->erase_blk_size != 0 && v->logical_blk_size != 0) { |
| 289 | mke2fs_args.push_back("-E"); |
| 290 | mke2fs_args.push_back( |
| 291 | android::base::StringPrintf("stride=%d,stripe-width=%d", raid_stride, raid_stripe_width)); |
| 292 | } |
| 293 | mke2fs_args.push_back(v->blk_device); |
| 294 | if (length != 0) { |
| 295 | mke2fs_args.push_back(std::to_string(length / kBlockSize)); |
| 296 | } |
| 297 | |
| 298 | int result = exec_cmd(mke2fs_args); |
| 299 | if (result == 0 && directory != nullptr) { |
| 300 | std::vector<std::string> e2fsdroid_args = { |
| 301 | "/sbin/e2fsdroid_static", |
| 302 | "-e", |
| 303 | "-f", |
| 304 | directory, |
| 305 | "-a", |
| 306 | volume, |
| 307 | v->blk_device, |
| 308 | }; |
| 309 | result = exec_cmd(e2fsdroid_args); |
| 310 | } |
| 311 | |
| 312 | if (result != 0) { |
| 313 | PLOG(ERROR) << "format_volume: Failed to make ext4 on " << v->blk_device; |
| 314 | return -1; |
| 315 | } |
| 316 | return 0; |
| 317 | } |
| 318 | |
| 319 | // Has to be f2fs because we checked earlier. |
| 320 | std::vector<std::string> f2fs_args = { "/sbin/mkfs.f2fs", "-t", "-d1", v->blk_device }; |
| 321 | if (length >= 512) { |
| 322 | f2fs_args.push_back(std::to_string(length / 512)); |
| 323 | } |
| 324 | |
| 325 | int result = exec_cmd(f2fs_args); |
| 326 | if (result != 0) { |
| 327 | PLOG(ERROR) << "format_volume: Failed to make f2fs on " << v->blk_device; |
| 328 | return -1; |
| 329 | } |
| 330 | return 0; |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 331 | } |
Doug Zongker | 239ac6a | 2013-08-20 16:03:25 -0700 | [diff] [blame] | 332 | |
Paul Lawrence | d0db337 | 2015-11-05 13:38:40 -0800 | [diff] [blame] | 333 | int format_volume(const char* volume) { |
Tao Bao | bb10e58 | 2017-07-22 16:30:34 -0700 | [diff] [blame] | 334 | return format_volume(volume, nullptr); |
Paul Lawrence | d0db337 | 2015-11-05 13:38:40 -0800 | [diff] [blame] | 335 | } |
| 336 | |
Doug Zongker | 239ac6a | 2013-08-20 16:03:25 -0700 | [diff] [blame] | 337 | int setup_install_mounts() { |
Tao Bao | 57130c4 | 2017-05-10 12:11:21 -0700 | [diff] [blame] | 338 | if (fstab == nullptr) { |
| 339 | LOG(ERROR) << "can't set up install mounts: no fstab loaded"; |
| 340 | return -1; |
| 341 | } |
| 342 | for (int i = 0; i < fstab->num_entries; ++i) { |
| 343 | const Volume* v = fstab->recs + i; |
| 344 | |
| 345 | // We don't want to do anything with "/". |
| 346 | if (strcmp(v->mount_point, "/") == 0) { |
| 347 | continue; |
| 348 | } |
| 349 | |
| 350 | if (strcmp(v->mount_point, "/tmp") == 0 || strcmp(v->mount_point, "/cache") == 0) { |
| 351 | if (ensure_path_mounted(v->mount_point) != 0) { |
Tao Bao | bb10e58 | 2017-07-22 16:30:34 -0700 | [diff] [blame] | 352 | LOG(ERROR) << "Failed to mount " << v->mount_point; |
Doug Zongker | 239ac6a | 2013-08-20 16:03:25 -0700 | [diff] [blame] | 353 | return -1; |
Tao Bao | 57130c4 | 2017-05-10 12:11:21 -0700 | [diff] [blame] | 354 | } |
| 355 | } else { |
| 356 | if (ensure_path_unmounted(v->mount_point) != 0) { |
Tao Bao | bb10e58 | 2017-07-22 16:30:34 -0700 | [diff] [blame] | 357 | LOG(ERROR) << "Failed to unmount " << v->mount_point; |
Tao Bao | 57130c4 | 2017-05-10 12:11:21 -0700 | [diff] [blame] | 358 | return -1; |
| 359 | } |
Doug Zongker | 239ac6a | 2013-08-20 16:03:25 -0700 | [diff] [blame] | 360 | } |
Tao Bao | 57130c4 | 2017-05-10 12:11:21 -0700 | [diff] [blame] | 361 | } |
| 362 | return 0; |
Doug Zongker | 239ac6a | 2013-08-20 16:03:25 -0700 | [diff] [blame] | 363 | } |