mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-03 06:47:04 -04:00
module-avb: check ioctl for success
This commit is contained in:
parent
07533eb590
commit
c8f2edd94e
1 changed files with 4 additions and 1 deletions
|
|
@ -78,7 +78,10 @@ static bool update_ts_refclk(struct gptp *gptp) {
|
||||||
int avail;
|
int avail;
|
||||||
uint8_t tmp;
|
uint8_t tmp;
|
||||||
|
|
||||||
ioctl(gptp->ptp_fd, FIONREAD, &avail);
|
if (ioctl(gptp->ptp_fd, FIONREAD, &avail) == -1) {
|
||||||
|
pw_log_warn("Failed to get number of byes in ptp_fd input buffer: %m");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
pw_log_debug("Flushing stale data: %u bytes", avail);
|
pw_log_debug("Flushing stale data: %u bytes", avail);
|
||||||
while (avail-- && read(gptp->ptp_fd, &tmp, 1));
|
while (avail-- && read(gptp->ptp_fd, &tmp, 1));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue