diff options
Diffstat (limited to 'audio_a2dp_hw/audio_a2dp_hw.c')
-rw-r--r-- | audio_a2dp_hw/audio_a2dp_hw.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/audio_a2dp_hw/audio_a2dp_hw.c b/audio_a2dp_hw/audio_a2dp_hw.c index 1933d5a75..663dbb83e 100644 --- a/audio_a2dp_hw/audio_a2dp_hw.c +++ b/audio_a2dp_hw/audio_a2dp_hw.c @@ -297,7 +297,7 @@ static int skt_read(int fd, void *p, size_t len) ts_log("skt_read recv", len, NULL); - if ((read = recv(fd, p, len, MSG_NOSIGNAL)) == -1) + if ((read = TEMP_FAILURE_RETRY(recv(fd, p, len, MSG_NOSIGNAL))) == -1) { ERROR("write failed with errno=%d\n", errno); return -1; @@ -319,12 +319,12 @@ static int skt_write(int fd, const void *p, size_t len) /* poll for 500 ms */ /* send time out */ - if (poll(&pfd, 1, 500) == 0) + if (TEMP_FAILURE_RETRY(poll(&pfd, 1, 500)) == 0) return 0; ts_log("skt_write", len, NULL); - if ((sent = send(fd, p, len, MSG_NOSIGNAL)) == -1) + if ((sent = TEMP_FAILURE_RETRY(send(fd, p, len, MSG_NOSIGNAL))) == -1) { ERROR("write failed with errno=%d\n", errno); return -1; @@ -355,14 +355,14 @@ static int skt_disconnect(int fd) static int a2dp_ctrl_receive(struct a2dp_stream_common *common, void* buffer, int length) { - int ret = recv(common->ctrl_fd, buffer, length, MSG_NOSIGNAL); + int ret = TEMP_FAILURE_RETRY(recv(common->ctrl_fd, buffer, length, MSG_NOSIGNAL)); if (ret < 0) { ERROR("ack failed (%s)", strerror(errno)); if (errno == EINTR) { /* retry again */ - ret = recv(common->ctrl_fd, buffer, length, MSG_NOSIGNAL); + ret = TEMP_FAILURE_RETRY(recv(common->ctrl_fd, buffer, length, MSG_NOSIGNAL)); if (ret < 0) { ERROR("ack failed (%s)", strerror(errno)); @@ -389,7 +389,7 @@ static int a2dp_command(struct a2dp_stream_common *common, char cmd) INFO("A2DP COMMAND %s", dump_a2dp_ctrl_event(cmd)); /* send command */ - if (send(common->ctrl_fd, &cmd, 1, MSG_NOSIGNAL) == -1) + if (TEMP_FAILURE_RETRY(send(common->ctrl_fd, &cmd, 1, MSG_NOSIGNAL)) == -1) { ERROR("cmd failed (%s)", strerror(errno)); skt_disconnect(common->ctrl_fd); @@ -463,13 +463,13 @@ static void a2dp_open_ctrl_path(struct a2dp_stream_common *common) break; ERROR("error : a2dp not ready, wait 250 ms and retry"); - usleep(250000); + TEMP_FAILURE_RETRY(usleep(250000)); skt_disconnect(common->ctrl_fd); common->ctrl_fd = AUDIO_SKT_DISCONNECTED; } /* ctrl channel not ready, wait a bit */ - usleep(250000); + TEMP_FAILURE_RETRY(usleep(250000)); } } @@ -675,7 +675,7 @@ static ssize_t out_write(struct audio_stream_out *stream, const void* buffer, ERROR("emulate a2dp write delay (%d us)", us_delay); - usleep(us_delay); + TEMP_FAILURE_RETRY(usleep(us_delay)); pthread_mutex_unlock(&out->common.lock); return -1; } @@ -1170,7 +1170,7 @@ static ssize_t in_read(struct audio_stream_in *stream, void* buffer, DEBUG("emulate a2dp read delay (%d us)", us_delay); - usleep(us_delay); + TEMP_FAILURE_RETRY(usleep(us_delay)); pthread_mutex_unlock(&in->common.lock); return -1; } @@ -1304,7 +1304,7 @@ static int adev_open_output_stream(struct audio_hw_device *dev, INFO("success"); /* Delay to ensure Headset is in proper state when START is initiated from DUT immediately after the connection due to ongoing music playback. */ - usleep(250000); + TEMP_FAILURE_RETRY(usleep(250000)); return 0; err_open: |