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:
parent
aea8f8175a
commit
6b36ba0b6e
@ -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 */
|
||||
};
|
||||
|
@ -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
|
||||
@ -314,14 +316,10 @@ 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 */
|
||||
{
|
||||
net_unlock();
|
||||
return -EINVAL;
|
||||
}
|
||||
default: /* Bad, memory must be corrupted */
|
||||
DEBUGPANIC(); /* PANIC if debug on */
|
||||
net_unlock();
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user