Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
  • Loading branch information
sshane committed Jan 18, 2025
1 parent 908a613 commit 3fcc9f7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions msgq/impl_msgq.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ Message *MSGQSubSocket::receive(bool non_blocking) {

pthread_sigmask(SIG_BLOCK, &mask, &old_mask);

int64_t timieout_ns = ((timeout != -1) ? timeout : 100) * 1000000;
int64_t timeout_ns = ((timeout != -1) ? timeout : 100) * 1000000;
auto start = steady_clock::now();

// Continue receiving messages until timeout or interruption by SIGINT or SIGTERM
while (rc == 0 && timieout_ns > 0) {
while (rc == 0 && timeout_ns > 0) {
struct timespec ts {
timieout_ns / 1000000000,
timieout_ns % 1000000000,
timeout_ns / 1000000000,
timeout_ns % 1000000000,
};

int ret = sigtimedwait(&mask, nullptr, &ts);
Expand All @@ -98,7 +98,7 @@ Message *MSGQSubSocket::receive(bool non_blocking) {
rc = msgq_msg_recv(&msg, q);

if (timeout != -1) {
timieout_ns -= duration_cast<nanoseconds>(steady_clock::now() - start).count();
timeout_ns -= duration_cast<nanoseconds>(steady_clock::now() - start).count();
start = steady_clock::now(); // Update start time
}
}
Expand Down

0 comments on commit 3fcc9f7

Please sign in to comment.