unix: fix -Wstrict-aliasing compiler warning

Fixes: https://github.com/libuv/libuv/issues/2563
PR-URL: https://github.com/libuv/libuv/pull/2564
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
This commit is contained in:
Ben Noordhuis 2019-12-08 12:27:31 +01:00
parent d01f050099
commit 0d3b487f5d

View File

@ -286,7 +286,7 @@ static int uv__fs_mkstemp(uv_fs_t* req) {
#ifdef O_CLOEXEC
if (no_cloexec_support == 0) {
*(int**)(&mkostemp_function) = dlsym(RTLD_DEFAULT, "mkostemp");
mkostemp_function = (int (*)(char*, int)) dlsym(RTLD_DEFAULT, "mkostemp");
/* We don't care about errors, but we do want to clean them up.
If there has been no error, then dlerror() will just return