Skip to content

Commit

Permalink
remove uneeded '-1 *' to negate an int
Browse files Browse the repository at this point in the history
  • Loading branch information
jmillan committed Dec 22, 2023
1 parent 230f4bc commit 4c9895b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions worker/src/DepLibUring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ inline static void onFdEvent(uv_poll_t* handle, int status, int events)
if (err < 0)
{
// Get positive errno.
int error = -1 * err;
int error = -err;

MS_ABORT("eventfd_read() failed: %s", std::strerror(error));
};
Expand Down Expand Up @@ -282,7 +282,7 @@ DepLibUring::LibUring::LibUring()
if (err < 0)
{
// Get positive errno.
int error = -1 * err;
int error = -err;

MS_THROW_ERROR("io_uring_queue_init() failed: %s", std::strerror(error));
}
Expand All @@ -300,7 +300,7 @@ DepLibUring::LibUring::LibUring()
if (err < 0)
{
// Get positive errno.
int error = -1 * err;
int error = -err;

MS_THROW_ERROR("io_uring_register_eventfd() failed: %s", std::strerror(error));
}
Expand All @@ -324,7 +324,7 @@ DepLibUring::LibUring::LibUring()
if (err < 0)
{
// Get positive errno.
int error = -1 * err;
int error = -err;

if (error == ENOMEM)
{
Expand Down Expand Up @@ -352,7 +352,7 @@ DepLibUring::LibUring::~LibUring()
if (err != 0)
{
// Get positive errno.
int error = -1 * err;
int error = -err;

MS_ABORT("close() failed: %s", std::strerror(error));
}
Expand Down Expand Up @@ -575,7 +575,7 @@ void DepLibUring::LibUring::Submit()
else
{
// Get positive errno.
int error = -1 * err;
int error = -err;

MS_ERROR("io_uring_submit() failed: %s", std::strerror(error));
}
Expand Down

0 comments on commit 4c9895b

Please sign in to comment.