Merge request !1477 from 'dp/libqcdm-write-fix'
libqcdm,tests: fix qcdm_send method for wwan https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1477
This commit is contained in:
@@ -95,16 +95,16 @@ qcdm_send (int fd, char *buf, size_t len)
|
||||
|
||||
while (i < len) {
|
||||
errno = 0;
|
||||
status = write (fd, &buf[i], 1);
|
||||
if (status < 0) {
|
||||
if (errno == EAGAIN) {
|
||||
status = write (fd, &buf[i], len - i);
|
||||
if (status <= 0) {
|
||||
if (errno == EAGAIN || status == 0) {
|
||||
eagain_count--;
|
||||
if (eagain_count <= 0)
|
||||
return FALSE;
|
||||
} else
|
||||
assert (errno == 0);
|
||||
} else
|
||||
i++;
|
||||
i += status;
|
||||
|
||||
usleep (1000);
|
||||
}
|
||||
|
||||
@@ -95,16 +95,16 @@ qcdm_send (int fd, char *buf, size_t len)
|
||||
|
||||
while (i < len) {
|
||||
errno = 0;
|
||||
status = write (fd, &buf[i], 1);
|
||||
if (status < 0) {
|
||||
if (errno == EAGAIN) {
|
||||
status = write (fd, &buf[i], len - i);
|
||||
if (status <= 0) {
|
||||
if (errno == EAGAIN || status == 0) {
|
||||
eagain_count--;
|
||||
if (eagain_count <= 0)
|
||||
return FALSE;
|
||||
} else
|
||||
assert (errno == 0);
|
||||
} else
|
||||
i++;
|
||||
i += status;
|
||||
|
||||
usleep (1000);
|
||||
}
|
||||
|
||||
@@ -96,16 +96,16 @@ qcdm_send (int fd, char *buf, size_t len)
|
||||
|
||||
while (i < len) {
|
||||
errno = 0;
|
||||
status = write (fd, &buf[i], 1);
|
||||
if (status < 0) {
|
||||
if (errno == EAGAIN) {
|
||||
status = write (fd, &buf[i], len - i);
|
||||
if (status <= 0) {
|
||||
if (errno == EAGAIN || status == 0) {
|
||||
eagain_count--;
|
||||
if (eagain_count <= 0)
|
||||
return FALSE;
|
||||
} else
|
||||
assert (errno == 0);
|
||||
} else
|
||||
i++;
|
||||
i += status;
|
||||
|
||||
usleep (1000);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user