Change-Id: Id90bebe5d40f1ac599d996e3e2da66217391a9eb
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
#else
static int __write_all(int fd, const char *buf, int len)
{
- int sent = 0;
+ int sent = 0, try = 0;
BT_DBG("+");
while (len > 0) {
written = write(fd, buf, len);
BT_DBG("written: %d", written);
if (written < 0) {
- if (errno == EINTR || errno == EAGAIN)
- continue;
+ if (errno == EINTR || errno == EAGAIN) {
+ try++;
+ if (try <= 49)
+ continue;
+ }
return -1;
}
len -= written;
buf += written;
sent += written;
+ try = 0;
}
BT_DBG("-");