Skip to content

Commit 0470c7f

Browse files
committed
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>
1 parent db31ecb commit 0470c7f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/node_file_utils.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ int WriteFileSync(const char* path, uv_buf_t* bufs, size_t buf_count) {
5959
nullptr);
6060
if (req.result <= 0) { // Error during write.
6161
// UV_EIO should not happen unless the file system is full.
62-
int err = req.result < 0 ? req.result : UV_EIO;
62+
int err = req.result < 0 ? static_cast<int>(req.result) : UV_EIO;
6363
uv_fs_req_cleanup(&req);
6464
uv_fs_close(nullptr, &req, fd, nullptr);
6565
uv_fs_req_cleanup(&req);

0 commit comments

Comments
 (0)