libqcdm,tests: fix qcdm_send method for wwan

The qcdm wwan device does not cope well with writing single bytes,
while it does not have any issue if longer chunks are written.

Fix qcdm_send accordingly, since it should not hurt the previously
supported devices.

Signed-off-by: Daniele Palmas <dnlplm@gmail.com>
This commit is contained in:
Daniele Palmas
2026-08-29 23:29:38 -05:00
committed by Dan Williams
parent cc29b5dac2
commit a838d3b98f
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);
}