Original commit message:

    unix: fix pedantic compiler warnings (#5052)

    Fixes: https://github.com/libuv/libuv/issues/5051

Fixes: https://github.com/nodejs/node/issues/63196
Refs: https://github.com/libuv/libuv/pull/5052
Refs: https://github.com/libuv/libuv/commit/a43e543dbffba93f014fe8360a5edbe8d6ce8500
PR-URL: https://github.com/nodejs/node/pull/63222
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
This commit is contained in:
Ali Hassan authored and Juan José Arboleda committed 2026-07-19 17:31:17 -05:00
1 parent 1870580609
commit 896508ee15
2 files changed
+14 -13

No files matched your search

+13 -12
View File
@@ -460,27 +460,28 @@ static ssize_t uv__preadv_or_pwritev(int fd,
off_t off,
_Atomic uintptr_t* cache,
int is_pread) {
ssize_t (*f)(int, const struct iovec*, uv__iovcnt, off_t);
void* p;
union {
ssize_t (*f)(int, const struct iovec*, uv__iovcnt, off_t);
void* p;
} u;
p = (void*) atomic_load_explicit(cache, memory_order_relaxed);
if (p == NULL) {
u.p = (void*) atomic_load_explicit(cache, memory_order_relaxed);
if (u.p == NULL) {
#ifdef RTLD_DEFAULT
/* Try _LARGEFILE_SOURCE version of preadv/pwritev first,
* then fall back to the plain version, for libcs like musl.
*/
p = dlsym(RTLD_DEFAULT, is_pread ? "preadv64" : "pwritev64");
if (p == NULL)
p = dlsym(RTLD_DEFAULT, is_pread ? "preadv" : "pwritev");
u.p = dlsym(RTLD_DEFAULT, is_pread ? "preadv64" : "pwritev64");
if (u.p == NULL)
u.p = dlsym(RTLD_DEFAULT, is_pread ? "preadv" : "pwritev");
dlerror(); /* Clear errors. */
#endif /* RTLD_DEFAULT */
if (p == NULL)
p = is_pread ? uv__preadv_emul : uv__pwritev_emul;
atomic_store_explicit(cache, (uintptr_t) p, memory_order_relaxed);
if (u.p == NULL)
u.f = is_pread ? uv__preadv_emul : uv__pwritev_emul;
atomic_store_explicit(cache, (uintptr_t) u.p, memory_order_relaxed);
}
f = p;
return f(fd, bufs, nbufs, off);
return u.f(fd, bufs, nbufs, off);
}
+1 -1
View File
@@ -957,7 +957,7 @@ void uv_free_cpu_info(uv_cpu_info_t* cpu_infos, int count) {
int i;
for (i = 0; i < count; i++)
uv__free(cpu_infos[i].model);
uv__free((char*) cpu_infos[i].model);
uv__free(cpu_infos);
#endif /* __linux__ */