diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2017-12-23 11:32:04 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2017-12-23 11:32:04 +0100 |
commit | e045e325df676108a5689231259bd6ecdae72909 (patch) | |
tree | 198d21ea73ceae6a96f2cb61b2967c0c60dfef8e /src/core/socket.c | |
parent | doc: update TRANSIENT-SETTINGS.md (diff) | |
download | systemd-e045e325df676108a5689231259bd6ecdae72909.tar.xz systemd-e045e325df676108a5689231259bd6ecdae72909.zip |
basic: introduce socket_protocol_{from,to}_name()
And use them where they can be applicable.
Diffstat (limited to 'src/core/socket.c')
-rw-r--r-- | src/core/socket.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/core/socket.c b/src/core/socket.c index 553bbe9f76..d45b528985 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -53,6 +53,7 @@ #include "signal-util.h" #include "smack-util.h" #include "socket.h" +#include "socket-protocol-list.h" #include "special.h" #include "string-table.h" #include "string-util.h" @@ -2783,16 +2784,16 @@ const char* socket_port_type_to_string(SocketPort *p) { SocketType socket_port_type_from_string(const char *s) { assert(s); - if (STR_IN_SET(t, "Stream", "Datagram", "SequentialPacket", "Netlink")) - return = SOCKET_SOCKET; - else if (streq(t, "Special")) - return = SOCKET_SPECIAL; - else if (streq(t, "MessageQueue")) - return = SOCKET_MQUEUE; - else if (streq(t, "FIFO")) - return = SOCKET_FIFO; - else if (streq(t, "USBFunction")) - return = SOCKET_USB_FUNCTION; + if (STR_IN_SET(s, "Stream", "Datagram", "SequentialPacket", "Netlink")) + return SOCKET_SOCKET; + else if (streq(s, "Special")) + return SOCKET_SPECIAL; + else if (streq(s, "MessageQueue")) + return SOCKET_MQUEUE; + else if (streq(s, "FIFO")) + return SOCKET_FIFO; + else if (streq(s, "USBFunction")) + return SOCKET_USB_FUNCTION; else return _SOCKET_TYPE_INVALID; } |