Skip to content

Commit 69f0b4a

Browse files
committed
zephyr/modusocket: Switch to net_pkt_append() returning length.
Requires patch in review.
1 parent 39d3335 commit 69f0b4a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

zephyr/modusocket.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,9 @@ STATIC mp_uint_t sock_write(mp_obj_t self_in, const void *buf, mp_uint_t size, i
316316
len = size;
317317
}
318318

319-
if (!net_pkt_append(send_pkt, len, buf, K_FOREVER)) {
320-
len = net_pkt_get_len(send_pkt);
321-
}
319+
// TODO: Return value of 0 is a hard case (as we wait forever, should
320+
// not happen).
321+
len = net_pkt_append(send_pkt, len, buf, K_FOREVER);
322322

323323
int err = net_context_send(send_pkt, /*cb*/NULL, K_FOREVER, NULL, NULL);
324324
if (err < 0) {

0 commit comments

Comments
 (0)