net/local: Remove LOCAL_TYPE_UNTYPED

let's represent the unbound local socket as LOCAL_TYPE_UNNAMED

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-12-18 14:49:02 +08:00 committed by Petro Karashchenko
parent aea8f8175a
commit 6b36ba0b6e
2 changed files with 7 additions and 10 deletions

View File

@ -57,8 +57,7 @@
enum local_type_e
{
LOCAL_TYPE_UNTYPED = 0, /* Type is not determined until the socket is bound */
LOCAL_TYPE_UNNAMED, /* A Unix socket that is not bound to any name */
LOCAL_TYPE_UNNAMED = 0, /* A Unix socket that is not bound to any name */
LOCAL_TYPE_PATHNAME, /* lc_path holds a null terminated string */
LOCAL_TYPE_ABSTRACT /* lc_path is length zero */
};

View File

@ -266,6 +266,8 @@ int psock_local_connect(FAR struct socket *psock,
switch (conn->lc_type)
{
case LOCAL_TYPE_UNNAMED: /* A Unix socket that is not bound to any name */
break;
case LOCAL_TYPE_ABSTRACT: /* lc_path is length zero */
{
#warning Missing logic
@ -315,15 +317,11 @@ int psock_local_connect(FAR struct socket *psock,
break;
default: /* Bad, memory must be corrupted */
DEBUGPANIC(); /* PANIC if debug on, else fall through */
case LOCAL_TYPE_UNTYPED: /* Type is not determined until the socket is bound */
{
DEBUGPANIC(); /* PANIC if debug on */
net_unlock();
return -EINVAL;
}
}
}
net_unlock();
return -EADDRNOTAVAIL;