src: fix -Wextra warning in WriteFileSync

`req.result` is `ssize_t` while `UV_EIO` is an enumerator, which GCC
flags as mixing enumerated and non-enumerated types in a conditional
expression.

Assisted-by: Devin
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66020
Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
This commit is contained in:
Antoine du Hamel committed 2026-09-18 17:46:45 +02:00
1 parent 060ed69df9
commit 1f24901c0c
1 file changed
+1 -1
+1 -1
View File
@@ -59,7 +59,7 @@ int WriteFileSync(const char* path, uv_buf_t* bufs, size_t buf_count) {
nullptr);
if (req.result <= 0) { // Error during write.
// UV_EIO should not happen unless the file system is full.
int err = req.result < 0 ? req.result : UV_EIO;
int err = req.result < 0 ? static_cast<int>(req.result) : UV_EIO;
uv_fs_req_cleanup(&req);
uv_fs_close(nullptr, &req, fd, nullptr);
uv_fs_req_cleanup(&req);