Commit a8a4ac6a authored by Andreas Schmidt's avatar Andreas Schmidt

Reset errno on timeout in _wait.

parent 0dbb64d2
Pipeline #2774 passed with stages
in 1 minute and 42 seconds
......@@ -324,8 +324,11 @@ int32_t PrrtSocket_receive_asap_wait(PrrtSocket *s, void *buf_ptr, struct sockad
do {
struct timespec deadline = abstime_from_now(1000 * 1000);
packet = PrrtPacketDeliveryStore_get_packet_timedwait(s->packetDeliveryStore, 0, MAX_TIMESTAMP, &deadline);
if (packet == NULL && errno == ETIMEDOUT) {
errno = 0;
}
if (PrrtSocket_closing(s)) {
debug(DEBUG_SOCKET, "Cancel asap_wait due to closing.");
PrrtPace_track_end(s->appDeliverPace);
return -1;
}
} while (!packet);
......@@ -368,7 +371,11 @@ int32_t PrrtSocket_receive_ordered_wait(PrrtSocket *s, void *buf_ptr, struct soc
prrtTimestamp_t now = PrrtClock_get_current_time_us();
struct timespec deadline = abstime_from_now(time_window_us);
packet = PrrtPacketDeliveryStore_get_packet_timedwait(s->packetDeliveryStore, now, now + time_window_us, &deadline);
if (packet == NULL && errno == ETIMEDOUT) {
errno = 0;
}
if (PrrtSocket_closing(s)) {
PrrtPace_track_end(s->appDeliverPace);
return -1;
}
} while (!packet);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment