mirror of
https://github.com/nodejs/node.git
synced 2026-11-29 14:27:57 -05:00
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:
1 file changed
+1
-1
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user