mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
system/fastboot: fix socket() parameter order for TCP transport
SOCK_CLOEXEC and SOCK_NONBLOCK were incorrectly passed as the third argument (protocol) instead of being OR'd into the second argument (type). This caused socket() to fail with EPROTONOSUPPORT (errno 93) on NuttX. Move SOCK_CLOEXEC | SOCK_NONBLOCK to the type parameter and set protocol to 0. Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
This commit is contained in:
parent
b986eef7a7
commit
460281a90f
1 changed files with 3 additions and 2 deletions
|
|
@ -1295,8 +1295,9 @@ static int fastboot_tcp_initialize(FAR struct fastboot_ctx_s *ctx)
|
|||
netinit_bringup();
|
||||
#endif
|
||||
|
||||
ctx->tran_fd[0] = socket(AF_INET, SOCK_STREAM,
|
||||
SOCK_CLOEXEC | SOCK_NONBLOCK);
|
||||
ctx->tran_fd[0] = socket(AF_INET,
|
||||
SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK,
|
||||
0);
|
||||
if (ctx->tran_fd[0] < 0)
|
||||
{
|
||||
fb_err("create socket failed %d", errno);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue