mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-17 21:56:45 +08:00
Add return types to tcpip_apimsg() and api_msg_post() to check ERR_MEM problems (api_lib.c can be change now).
This commit is contained in:
@@ -848,10 +848,10 @@ api_msg_input(struct api_msg *msg)
|
||||
decode[msg->type](&(msg->msg));
|
||||
}
|
||||
|
||||
void
|
||||
err_t
|
||||
api_msg_post(struct api_msg *msg)
|
||||
{
|
||||
tcpip_apimsg(msg);
|
||||
return tcpip_apimsg(msg);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -267,17 +267,18 @@ tcpip_callback(void (*f)(void *ctx), void *ctx)
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
void
|
||||
err_t
|
||||
tcpip_apimsg(struct api_msg *apimsg)
|
||||
{
|
||||
struct tcpip_msg *msg;
|
||||
msg = memp_malloc(MEMP_TCPIP_MSG);
|
||||
if (msg == NULL) {
|
||||
return;
|
||||
return ERR_MEM;
|
||||
}
|
||||
msg->type = TCPIP_MSG_API;
|
||||
msg->msg.apimsg = apimsg;
|
||||
sys_mbox_post(mbox, msg);
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user