diff options
author | Susant Sahani <ssahani@gmail.com> | 2016-01-22 05:11:44 +0100 |
---|---|---|
committer | Susant Sahani <ssahani@gmail.com> | 2016-01-22 05:11:44 +0100 |
commit | 7b7afdfc072b14a4fa4dc195f50becaa7cecc5e8 (patch) | |
tree | 84621f6aee876e3f285d7085b1dbe1d161bcc29b /src/basic/socket-label.c | |
parent | Merge pull request #1359 from jengelh/ue (diff) | |
download | systemd-7b7afdfc072b14a4fa4dc195f50becaa7cecc5e8.tar.xz systemd-7b7afdfc072b14a4fa4dc195f50becaa7cecc5e8.zip |
systemd-activate: Add support for datagram sockets
core: Add flexible way to provide socket type
the socket type should be a diffrent argumet
in make_socket_fd . In this way we can set the socket
type like SOCK_STREAM SOCK_DGRAM in the address.
journal-remote: modify make_socket_fd
Diffstat (limited to 'src/basic/socket-label.c')
-rw-r--r-- | src/basic/socket-label.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/basic/socket-label.c b/src/basic/socket-label.c index e169439e04..bd206586ce 100644 --- a/src/basic/socket-label.c +++ b/src/basic/socket-label.c @@ -147,7 +147,7 @@ int socket_address_listen( return r; } -int make_socket_fd(int log_level, const char* address, int flags) { +int make_socket_fd(int log_level, const char* address, int type, int flags) { SocketAddress a; int fd, r; @@ -155,7 +155,9 @@ int make_socket_fd(int log_level, const char* address, int flags) { if (r < 0) return log_error_errno(r, "Failed to parse socket address \"%s\": %m", address); - fd = socket_address_listen(&a, flags, SOMAXCONN, SOCKET_ADDRESS_DEFAULT, + a.type = type; + + fd = socket_address_listen(&a, type | flags, SOMAXCONN, SOCKET_ADDRESS_DEFAULT, NULL, false, false, false, 0755, 0644, NULL); if (fd < 0 || log_get_max_level() >= log_level) { _cleanup_free_ char *p = NULL; |