Correct error handling when no message is defined.
FossilOrigin-Name: 964d457584bbfbb9399a162faafd12b29a1e2f18f09ee4d3ec98aaaba6af9f19
This commit is contained in:
parent
986248cc67
commit
3297370f34
@ -76,8 +76,10 @@ int conn_send_msg(struct conn * conn, uint8_t *rawmsg)
|
|||||||
int cw_send_request(struct conn *conn,int msg_id)
|
int cw_send_request(struct conn *conn,int msg_id)
|
||||||
{
|
{
|
||||||
cw_init_request(conn, msg_id);
|
cw_init_request(conn, msg_id);
|
||||||
if ( cw_put_msg(conn, conn->req_buffer) == -1 )
|
if ( cw_put_msg(conn, conn->req_buffer) == -1 ){
|
||||||
return 0;
|
errno=ENOMSG;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
conn_send_msg(conn, conn->req_buffer);
|
conn_send_msg(conn, conn->req_buffer);
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user