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:
Dan Williams
2026-08-29 23:32:50 -05:00
3 changed files with 12 additions and 12 deletions
+4 -4
View File
@@ -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);
}
+4 -4
View File
@@ -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);
}
+4 -4
View File
@@ -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);
}