Jeremy Kerr | 9326d77 | 2016-03-17 17:15:02 +0800 | [diff] [blame] | 1 | /** |
| 2 | * Copyright © 2016 IBM Corporation |
| 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 | */ |
Jeremy Kerr | d66195c | 2016-03-16 17:24:51 +0800 | [diff] [blame] | 16 | |
Kun Yi | 6424cc3 | 2018-06-14 14:09:28 -0700 | [diff] [blame] | 17 | #include <ctype.h> |
Jeremy Kerr | d66195c | 2016-03-16 17:24:51 +0800 | [diff] [blame] | 18 | #include <err.h> |
Andrew Jeffery | d30d757 | 2023-04-18 14:51:51 +0930 | [diff] [blame] | 19 | #include <errno.h> |
Jeremy Kerr | d66195c | 2016-03-16 17:24:51 +0800 | [diff] [blame] | 20 | #include <fcntl.h> |
Kun Yi | 6424cc3 | 2018-06-14 14:09:28 -0700 | [diff] [blame] | 21 | #include <limits.h> |
Jeremy Kerr | d66195c | 2016-03-16 17:24:51 +0800 | [diff] [blame] | 22 | #include <stdint.h> |
| 23 | #include <stdio.h> |
| 24 | #include <stdlib.h> |
| 25 | #include <string.h> |
| 26 | #include <strings.h> |
Benjamin Fair | fcbdea9 | 2018-06-04 14:19:25 -0700 | [diff] [blame] | 27 | #include <termios.h> /* for speed_t */ |
Jeremy Kerr | d66195c | 2016-03-16 17:24:51 +0800 | [diff] [blame] | 28 | #include <unistd.h> |
| 29 | |
| 30 | #include <sys/mman.h> |
| 31 | #include <sys/stat.h> |
Cheng C Yang | f9c8f6c | 2019-03-04 18:39:52 +0800 | [diff] [blame] | 32 | #include "console-server.h" |
Jeremy Kerr | d66195c | 2016-03-16 17:24:51 +0800 | [diff] [blame] | 33 | |
Jeremy Kerr | e440a40 | 2016-03-17 16:34:14 +0800 | [diff] [blame] | 34 | static const char *config_default_filename = SYSCONFDIR "/obmc-console.conf"; |
Jeremy Kerr | d66195c | 2016-03-16 17:24:51 +0800 | [diff] [blame] | 35 | |
| 36 | struct config_item { |
Andrew Jeffery | a72711a | 2023-04-18 18:19:41 +0930 | [diff] [blame] | 37 | char *name; |
| 38 | char *value; |
| 39 | struct config_item *next; |
Jeremy Kerr | d66195c | 2016-03-16 17:24:51 +0800 | [diff] [blame] | 40 | }; |
| 41 | |
| 42 | struct config { |
Andrew Jeffery | a72711a | 2023-04-18 18:19:41 +0930 | [diff] [blame] | 43 | struct config_item *items; |
Jeremy Kerr | d66195c | 2016-03-16 17:24:51 +0800 | [diff] [blame] | 44 | }; |
| 45 | |
| 46 | const char *config_get_value(struct config *config, const char *name) |
| 47 | { |
| 48 | struct config_item *item; |
| 49 | |
Andrew Jeffery | ba2af96 | 2023-05-02 15:02:56 +0930 | [diff] [blame] | 50 | if (!config) { |
| 51 | return NULL; |
| 52 | } |
| 53 | |
Andrew Jeffery | 2834c5b | 2023-04-19 12:47:09 +0930 | [diff] [blame] | 54 | for (item = config->items; item; item = item->next) { |
| 55 | if (!strcasecmp(item->name, name)) { |
Jeremy Kerr | d66195c | 2016-03-16 17:24:51 +0800 | [diff] [blame] | 56 | return item->value; |
Andrew Jeffery | 2834c5b | 2023-04-19 12:47:09 +0930 | [diff] [blame] | 57 | } |
| 58 | } |
Jeremy Kerr | d66195c | 2016-03-16 17:24:51 +0800 | [diff] [blame] | 59 | |
| 60 | return NULL; |
| 61 | } |
| 62 | |
| 63 | static void config_parse(struct config *config, char *buf) |
| 64 | { |
| 65 | struct config_item *item; |
Andrew Jeffery | b70f871 | 2023-04-19 12:53:34 +0930 | [diff] [blame] | 66 | char *name; |
| 67 | char *value; |
| 68 | char *p; |
| 69 | char *line; |
Jeremy Kerr | d66195c | 2016-03-16 17:24:51 +0800 | [diff] [blame] | 70 | |
| 71 | for (p = NULL, line = strtok_r(buf, "\n", &p); line; |
Andrew Jeffery | a72711a | 2023-04-18 18:19:41 +0930 | [diff] [blame] | 72 | line = strtok_r(NULL, "\n", &p)) { |
Andrew Jeffery | d30d757 | 2023-04-18 14:51:51 +0930 | [diff] [blame] | 73 | int rc; |
Jeremy Kerr | d66195c | 2016-03-16 17:24:51 +0800 | [diff] [blame] | 74 | |
| 75 | /* trim leading space */ |
Andrew Jeffery | 2834c5b | 2023-04-19 12:47:09 +0930 | [diff] [blame] | 76 | for (; *line == ' ' || *line == '\t'; line++) { |
Jeremy Kerr | d66195c | 2016-03-16 17:24:51 +0800 | [diff] [blame] | 77 | ; |
Andrew Jeffery | 2834c5b | 2023-04-19 12:47:09 +0930 | [diff] [blame] | 78 | } |
Jeremy Kerr | d66195c | 2016-03-16 17:24:51 +0800 | [diff] [blame] | 79 | |
| 80 | /* skip comments */ |
Andrew Jeffery | 2834c5b | 2023-04-19 12:47:09 +0930 | [diff] [blame] | 81 | if (*line == '#') { |
Jeremy Kerr | d66195c | 2016-03-16 17:24:51 +0800 | [diff] [blame] | 82 | continue; |
Andrew Jeffery | 2834c5b | 2023-04-19 12:47:09 +0930 | [diff] [blame] | 83 | } |
Jeremy Kerr | d66195c | 2016-03-16 17:24:51 +0800 | [diff] [blame] | 84 | |
Andrew Jeffery | d30d757 | 2023-04-18 14:51:51 +0930 | [diff] [blame] | 85 | name = malloc(strlen(line)); |
| 86 | value = malloc(strlen(line)); |
| 87 | if (name && value) { |
| 88 | rc = sscanf(line, "%[^ =] = %s ", name, value); |
| 89 | } else { |
| 90 | rc = -ENOMEM; |
| 91 | } |
Jeremy Kerr | d66195c | 2016-03-16 17:24:51 +0800 | [diff] [blame] | 92 | |
Andrew Jeffery | d30d757 | 2023-04-18 14:51:51 +0930 | [diff] [blame] | 93 | if (rc != 2) { |
Jeremy Kerr | d66195c | 2016-03-16 17:24:51 +0800 | [diff] [blame] | 94 | free(name); |
| 95 | free(value); |
| 96 | continue; |
| 97 | } |
| 98 | |
| 99 | /* create a new item and add to our list */ |
| 100 | item = malloc(sizeof(*item)); |
| 101 | item->name = name; |
| 102 | item->value = value; |
| 103 | item->next = config->items; |
| 104 | config->items = item; |
| 105 | } |
| 106 | } |
| 107 | |
Jeremy Kerr | 6c8d781 | 2016-03-17 15:05:45 +0800 | [diff] [blame] | 108 | static struct config *config_init_fd(int fd, const char *filename) |
Jeremy Kerr | d66195c | 2016-03-16 17:24:51 +0800 | [diff] [blame] | 109 | { |
| 110 | struct config *config; |
Andrew Jeffery | b70f871 | 2023-04-19 12:53:34 +0930 | [diff] [blame] | 111 | size_t size; |
| 112 | size_t len; |
Andrew Jeffery | 5c359cc | 2023-04-18 22:50:07 +0930 | [diff] [blame] | 113 | ssize_t rc; |
Jeremy Kerr | 2eb56f5 | 2016-03-17 14:55:14 +0800 | [diff] [blame] | 114 | char *buf; |
Jeremy Kerr | d66195c | 2016-03-16 17:24:51 +0800 | [diff] [blame] | 115 | |
Jeremy Kerr | 2eb56f5 | 2016-03-17 14:55:14 +0800 | [diff] [blame] | 116 | size = 4096; |
| 117 | len = 0; |
| 118 | buf = malloc(size + 1); |
Jeremy Kerr | 6c8d781 | 2016-03-17 15:05:45 +0800 | [diff] [blame] | 119 | config = NULL; |
Jeremy Kerr | d66195c | 2016-03-16 17:24:51 +0800 | [diff] [blame] | 120 | |
Jeremy Kerr | 2eb56f5 | 2016-03-17 14:55:14 +0800 | [diff] [blame] | 121 | for (;;) { |
| 122 | rc = read(fd, buf + len, size - len); |
Jeremy Kerr | d66195c | 2016-03-16 17:24:51 +0800 | [diff] [blame] | 123 | if (rc < 0) { |
Jeremy Kerr | 6c8d781 | 2016-03-17 15:05:45 +0800 | [diff] [blame] | 124 | warn("Can't read from configuration file %s", filename); |
| 125 | goto out_free; |
Jeremy Kerr | d66195c | 2016-03-16 17:24:51 +0800 | [diff] [blame] | 126 | |
| 127 | } else if (!rc) { |
| 128 | break; |
| 129 | } |
Jeremy Kerr | 2eb56f5 | 2016-03-17 14:55:14 +0800 | [diff] [blame] | 130 | len += rc; |
| 131 | if (len == size) { |
| 132 | size <<= 1; |
| 133 | buf = realloc(buf, size + 1); |
| 134 | } |
Jeremy Kerr | d66195c | 2016-03-16 17:24:51 +0800 | [diff] [blame] | 135 | } |
| 136 | buf[len] = '\0'; |
| 137 | |
Jeremy Kerr | d66195c | 2016-03-16 17:24:51 +0800 | [diff] [blame] | 138 | config = malloc(sizeof(*config)); |
| 139 | config->items = NULL; |
| 140 | |
| 141 | config_parse(config, buf); |
| 142 | |
Jeremy Kerr | 6c8d781 | 2016-03-17 15:05:45 +0800 | [diff] [blame] | 143 | out_free: |
Jeremy Kerr | d66195c | 2016-03-16 17:24:51 +0800 | [diff] [blame] | 144 | free(buf); |
Jeremy Kerr | 6c8d781 | 2016-03-17 15:05:45 +0800 | [diff] [blame] | 145 | return config; |
| 146 | } |
| 147 | |
| 148 | struct config *config_init(const char *filename) |
| 149 | { |
| 150 | struct config *config; |
| 151 | int fd; |
| 152 | |
Andrew Jeffery | 2834c5b | 2023-04-19 12:47:09 +0930 | [diff] [blame] | 153 | if (!filename) { |
Jeremy Kerr | 6c8d781 | 2016-03-17 15:05:45 +0800 | [diff] [blame] | 154 | filename = config_default_filename; |
Andrew Jeffery | 2834c5b | 2023-04-19 12:47:09 +0930 | [diff] [blame] | 155 | } |
Jeremy Kerr | 6c8d781 | 2016-03-17 15:05:45 +0800 | [diff] [blame] | 156 | |
| 157 | fd = open(filename, O_RDONLY); |
| 158 | if (fd < 0) { |
| 159 | warn("Can't open configuration file %s", filename); |
| 160 | return NULL; |
| 161 | } |
| 162 | |
| 163 | config = config_init_fd(fd, filename); |
| 164 | |
| 165 | close(fd); |
Jeremy Kerr | d66195c | 2016-03-16 17:24:51 +0800 | [diff] [blame] | 166 | |
| 167 | return config; |
Jeremy Kerr | d66195c | 2016-03-16 17:24:51 +0800 | [diff] [blame] | 168 | } |
| 169 | |
| 170 | void config_fini(struct config *config) |
| 171 | { |
Andrew Jeffery | b70f871 | 2023-04-19 12:53:34 +0930 | [diff] [blame] | 172 | struct config_item *item; |
| 173 | struct config_item *next; |
Jeremy Kerr | d66195c | 2016-03-16 17:24:51 +0800 | [diff] [blame] | 174 | |
Andrew Jeffery | ba2af96 | 2023-05-02 15:02:56 +0930 | [diff] [blame] | 175 | if (!config) { |
| 176 | return; |
| 177 | } |
| 178 | |
Jeremy Kerr | d66195c | 2016-03-16 17:24:51 +0800 | [diff] [blame] | 179 | for (item = config->items; item; item = next) { |
| 180 | next = item->next; |
| 181 | free(item->name); |
| 182 | free(item->value); |
| 183 | free(item); |
| 184 | } |
| 185 | |
| 186 | free(config); |
| 187 | } |
Jeremy Kerr | 6c8d781 | 2016-03-17 15:05:45 +0800 | [diff] [blame] | 188 | |
Benjamin Fair | fcbdea9 | 2018-06-04 14:19:25 -0700 | [diff] [blame] | 189 | struct terminal_speed_name { |
Andrew Jeffery | a72711a | 2023-04-18 18:19:41 +0930 | [diff] [blame] | 190 | speed_t speed; |
| 191 | uint32_t baud; |
| 192 | const char *name; |
Benjamin Fair | fcbdea9 | 2018-06-04 14:19:25 -0700 | [diff] [blame] | 193 | }; |
| 194 | |
Andrew Jeffery | a72711a | 2023-04-18 18:19:41 +0930 | [diff] [blame] | 195 | #define TERM_SPEED(x) \ |
| 196 | { \ |
| 197 | B##x, x, #x \ |
| 198 | } |
Cheng C Yang | f9c8f6c | 2019-03-04 18:39:52 +0800 | [diff] [blame] | 199 | |
Andrew Jeffery | a72711a | 2023-04-18 18:19:41 +0930 | [diff] [blame] | 200 | // clang-format off |
Cheng C Yang | f9c8f6c | 2019-03-04 18:39:52 +0800 | [diff] [blame] | 201 | static const struct terminal_speed_name terminal_speeds[] = { |
| 202 | TERM_SPEED(50), |
| 203 | TERM_SPEED(75), |
| 204 | TERM_SPEED(110), |
| 205 | TERM_SPEED(134), |
| 206 | TERM_SPEED(150), |
| 207 | TERM_SPEED(200), |
| 208 | TERM_SPEED(300), |
| 209 | TERM_SPEED(600), |
| 210 | TERM_SPEED(1200), |
| 211 | TERM_SPEED(1800), |
| 212 | TERM_SPEED(2400), |
| 213 | TERM_SPEED(4800), |
| 214 | TERM_SPEED(9600), |
| 215 | TERM_SPEED(19200), |
| 216 | TERM_SPEED(38400), |
| 217 | TERM_SPEED(57600), |
| 218 | TERM_SPEED(115200), |
| 219 | TERM_SPEED(230400), |
| 220 | TERM_SPEED(460800), |
| 221 | TERM_SPEED(500000), |
| 222 | TERM_SPEED(576000), |
| 223 | TERM_SPEED(921600), |
| 224 | TERM_SPEED(1000000), |
| 225 | TERM_SPEED(1152000), |
| 226 | TERM_SPEED(1500000), |
| 227 | TERM_SPEED(2000000), |
| 228 | TERM_SPEED(2500000), |
| 229 | TERM_SPEED(3000000), |
| 230 | TERM_SPEED(3500000), |
| 231 | TERM_SPEED(4000000), |
| 232 | }; |
Andrew Jeffery | a72711a | 2023-04-18 18:19:41 +0930 | [diff] [blame] | 233 | // clang-format on |
Cheng C Yang | f9c8f6c | 2019-03-04 18:39:52 +0800 | [diff] [blame] | 234 | |
| 235 | int config_parse_baud(speed_t *speed, const char *baud_string) |
| 236 | { |
Benjamin Fair | fcbdea9 | 2018-06-04 14:19:25 -0700 | [diff] [blame] | 237 | size_t i; |
| 238 | |
Cheng C Yang | f9c8f6c | 2019-03-04 18:39:52 +0800 | [diff] [blame] | 239 | for (i = 0; i < ARRAY_SIZE(terminal_speeds); i++) { |
Benjamin Fair | fcbdea9 | 2018-06-04 14:19:25 -0700 | [diff] [blame] | 240 | if (strcmp(baud_string, terminal_speeds[i].name) == 0) { |
| 241 | *speed = terminal_speeds[i].speed; |
| 242 | return 0; |
| 243 | } |
| 244 | } |
| 245 | return -1; |
| 246 | } |
| 247 | |
Cheng C Yang | f9c8f6c | 2019-03-04 18:39:52 +0800 | [diff] [blame] | 248 | uint32_t parse_baud_to_int(speed_t speed) |
| 249 | { |
| 250 | size_t i; |
| 251 | |
| 252 | for (i = 0; i < ARRAY_SIZE(terminal_speeds); i++) { |
| 253 | if (terminal_speeds[i].speed == speed) { |
| 254 | return terminal_speeds[i].baud; |
| 255 | } |
| 256 | } |
| 257 | return 0; |
| 258 | } |
| 259 | |
| 260 | speed_t parse_int_to_baud(uint32_t baud) |
| 261 | { |
| 262 | size_t i; |
| 263 | |
| 264 | for (i = 0; i < ARRAY_SIZE(terminal_speeds); i++) { |
| 265 | if (terminal_speeds[i].baud == baud) { |
| 266 | return terminal_speeds[i].speed; |
| 267 | } |
| 268 | } |
| 269 | return 0; |
| 270 | } |
| 271 | |
Kun Yi | 6424cc3 | 2018-06-14 14:09:28 -0700 | [diff] [blame] | 272 | int config_parse_logsize(const char *size_str, size_t *size) |
| 273 | { |
| 274 | struct size_suffix_shift { |
| 275 | /* Left shiftwidth corresponding to the suffix. */ |
Andrew Jeffery | a72711a | 2023-04-18 18:19:41 +0930 | [diff] [blame] | 276 | size_t shiftwidth; |
| 277 | int unit; |
Kun Yi | 6424cc3 | 2018-06-14 14:09:28 -0700 | [diff] [blame] | 278 | }; |
| 279 | |
| 280 | const struct size_suffix_shift suffixes[] = { |
| 281 | { 10, 'k' }, |
| 282 | { 20, 'M' }, |
| 283 | { 30, 'G' }, |
| 284 | }; |
Andrew Jeffery | a72711a | 2023-04-18 18:19:41 +0930 | [diff] [blame] | 285 | const size_t num_suffixes = |
| 286 | sizeof(suffixes) / sizeof(struct size_suffix_shift); |
Kun Yi | 6424cc3 | 2018-06-14 14:09:28 -0700 | [diff] [blame] | 287 | size_t logsize; |
| 288 | char *suffix; |
| 289 | size_t i; |
| 290 | |
Andrew Jeffery | 2834c5b | 2023-04-19 12:47:09 +0930 | [diff] [blame] | 291 | if (!size_str) { |
Kun Yi | 6424cc3 | 2018-06-14 14:09:28 -0700 | [diff] [blame] | 292 | return -1; |
Andrew Jeffery | 2834c5b | 2023-04-19 12:47:09 +0930 | [diff] [blame] | 293 | } |
Kun Yi | 6424cc3 | 2018-06-14 14:09:28 -0700 | [diff] [blame] | 294 | |
| 295 | logsize = strtoul(size_str, &suffix, 0); |
Andrew Jeffery | 2834c5b | 2023-04-19 12:47:09 +0930 | [diff] [blame] | 296 | if (logsize == 0 || logsize >= UINT32_MAX || suffix == size_str) { |
Kun Yi | 6424cc3 | 2018-06-14 14:09:28 -0700 | [diff] [blame] | 297 | return -1; |
Andrew Jeffery | 2834c5b | 2023-04-19 12:47:09 +0930 | [diff] [blame] | 298 | } |
Kun Yi | 6424cc3 | 2018-06-14 14:09:28 -0700 | [diff] [blame] | 299 | |
| 300 | /* Ignore spaces between number and suffix */ |
Andrew Jeffery | 2834c5b | 2023-04-19 12:47:09 +0930 | [diff] [blame] | 301 | while (*suffix && isspace(*suffix)) { |
Kun Yi | 6424cc3 | 2018-06-14 14:09:28 -0700 | [diff] [blame] | 302 | suffix++; |
Andrew Jeffery | 2834c5b | 2023-04-19 12:47:09 +0930 | [diff] [blame] | 303 | } |
Kun Yi | 6424cc3 | 2018-06-14 14:09:28 -0700 | [diff] [blame] | 304 | |
| 305 | for (i = 0; i < num_suffixes; i++) { |
| 306 | if (*suffix == suffixes[i].unit) { |
| 307 | /* |
| 308 | * If logsize overflows, probably something was wrong. |
| 309 | * Return instead of clamping to an arbitrary value. |
| 310 | */ |
Andrew Jeffery | 2834c5b | 2023-04-19 12:47:09 +0930 | [diff] [blame] | 311 | if (logsize > (UINT32_MAX >> suffixes[i].shiftwidth)) { |
Kun Yi | 6424cc3 | 2018-06-14 14:09:28 -0700 | [diff] [blame] | 312 | return -1; |
Andrew Jeffery | 2834c5b | 2023-04-19 12:47:09 +0930 | [diff] [blame] | 313 | } |
Kun Yi | 6424cc3 | 2018-06-14 14:09:28 -0700 | [diff] [blame] | 314 | |
| 315 | logsize <<= suffixes[i].shiftwidth; |
| 316 | suffix++; |
| 317 | break; |
| 318 | } |
| 319 | } |
| 320 | |
| 321 | /* Allow suffix like 'kB' */ |
Andrew Jeffery | 2834c5b | 2023-04-19 12:47:09 +0930 | [diff] [blame] | 322 | while (*suffix && (tolower(*suffix) == 'b' || isspace(*suffix))) { |
Kun Yi | 6424cc3 | 2018-06-14 14:09:28 -0700 | [diff] [blame] | 323 | suffix++; |
Andrew Jeffery | 2834c5b | 2023-04-19 12:47:09 +0930 | [diff] [blame] | 324 | } |
Kun Yi | 6424cc3 | 2018-06-14 14:09:28 -0700 | [diff] [blame] | 325 | |
| 326 | if (*suffix) { |
| 327 | warn("Invalid suffix!"); |
| 328 | return -1; |
| 329 | } |
| 330 | |
| 331 | *size = logsize; |
| 332 | return 0; |
| 333 | } |
| 334 | |
Ninad Palsule | 5ba20b5 | 2023-05-12 14:03:15 -0500 | [diff] [blame] | 335 | /* Default console id if not specified on command line or in config */ |
| 336 | #define DEFAULT_CONSOLE_ID "default" |
| 337 | |
| 338 | /* Get the console id */ |
| 339 | const char *config_resolve_console_id(struct config *config, const char *id_arg) |
| 340 | { |
| 341 | const char *configured; |
| 342 | |
| 343 | if (id_arg) { |
| 344 | return id_arg; |
| 345 | } |
| 346 | |
| 347 | if ((configured = config_get_value(config, "console-id"))) { |
| 348 | return configured; |
| 349 | } |
| 350 | |
| 351 | if ((configured = config_get_value(config, "socket-id"))) { |
| 352 | return configured; |
| 353 | } |
| 354 | |
| 355 | return DEFAULT_CONSOLE_ID; |
| 356 | } |
| 357 | |
Jeremy Kerr | 6c8d781 | 2016-03-17 15:05:45 +0800 | [diff] [blame] | 358 | #ifdef CONFIG_TEST |
| 359 | int main(void) |
| 360 | { |
| 361 | struct config_item *item; |
| 362 | struct config *config; |
| 363 | |
| 364 | config = config_init_fd(STDIN_FILENO, "<stdin>"); |
| 365 | if (!config) |
| 366 | return EXIT_FAILURE; |
| 367 | |
| 368 | for (item = config->items; item; item = item->next) |
| 369 | printf("%s: %s\n", item->name, item->value); |
| 370 | |
| 371 | config_fini(config); |
| 372 | |
| 373 | return EXIT_SUCCESS; |
Jeremy Kerr | 6c8d781 | 2016-03-17 15:05:45 +0800 | [diff] [blame] | 374 | } |
| 375 | #endif |