| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent eba9c34 commit ad91efc
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -460,27 +460,28 @@ static ssize_t uv__preadv_or_pwritev(int fd, | |||
| 460 | 460 | off_t off, | |
| 461 | 461 | _Atomic uintptr_t* cache, | |
| 462 | 462 | int is_pread) { | |
| 463 | - ssize_t (*f)(int, const struct iovec*, uv__iovcnt, off_t); | ||
| 464 | - void* p; | ||
| 463 | + union { | ||
| 464 | + ssize_t (*f)(int, const struct iovec*, uv__iovcnt, off_t); | ||
| 465 | + void* p; | ||
| 466 | + } u; | ||
| 465 | 467 | ||
| 466 | - p = (void*) atomic_load_explicit(cache, memory_order_relaxed); | ||
| 467 | - if (p == NULL) { | ||
| 468 | + u.p = (void*) atomic_load_explicit(cache, memory_order_relaxed); | ||
| 469 | + if (u.p == NULL) { | ||
| 468 | 470 | #ifdef RTLD_DEFAULT | |
| 469 | 471 | /* Try _LARGEFILE_SOURCE version of preadv/pwritev first, | |
| 470 | 472 | * then fall back to the plain version, for libcs like musl. | |
| 471 | 473 | */ | |
| 472 | - p = dlsym(RTLD_DEFAULT, is_pread ? "preadv64" : "pwritev64"); | ||
| 473 | - if (p == NULL) | ||
| 474 | - p = dlsym(RTLD_DEFAULT, is_pread ? "preadv" : "pwritev"); | ||
| 474 | + u.p = dlsym(RTLD_DEFAULT, is_pread ? "preadv64" : "pwritev64"); | ||
| 475 | + if (u.p == NULL) | ||
| 476 | + u.p = dlsym(RTLD_DEFAULT, is_pread ? "preadv" : "pwritev"); | ||
| 475 | 477 | dlerror(); /* Clear errors. */ | |
| 476 | 478 | #endif /* RTLD_DEFAULT */ | |
| 477 | - if (p == NULL) | ||
| 478 | - p = is_pread ? uv__preadv_emul : uv__pwritev_emul; | ||
| 479 | - atomic_store_explicit(cache, (uintptr_t) p, memory_order_relaxed); | ||
| 479 | + if (u.p == NULL) | ||
| 480 | + u.f = is_pread ? uv__preadv_emul : uv__pwritev_emul; | ||
| 481 | + atomic_store_explicit(cache, (uintptr_t) u.p, memory_order_relaxed); | ||
| 480 | 482 | } | |
| 481 | 483 | ||
| 482 | - f = p; | ||
| 483 | - return f(fd, bufs, nbufs, off); | ||
| 484 | + return u.f(fd, bufs, nbufs, off); | ||
| 484 | 485 | } | |
| 485 | 486 | ||
| 486 | 487 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -957,7 +957,7 @@ void uv_free_cpu_info(uv_cpu_info_t* cpu_infos, int count) { | |||
| 957 | 957 | int i; | |
| 958 | 958 | ||
| 959 | 959 | for (i = 0; i < count; i++) | |
| 960 | - uv__free(cpu_infos[i].model); | ||
| 960 | + uv__free((char*) cpu_infos[i].model); | ||
| 961 | 961 | ||
| 962 | 962 | uv__free(cpu_infos); | |
| 963 | 963 | #endif /* __linux__ */ | |
| Back | FazBrowse Home | New Git URL |
0 commit comments