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:
fbernon
2007-03-19 20:35:32 +00:00
parent e4cd00b5ea
commit b035a6196a
5 changed files with 12 additions and 7 deletions

View File

@@ -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);
}

View File

@@ -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