mirror of
https://github.com/troglobit/finit.git
synced 2026-10-02 05:52:48 +07:00
The unix(7) man page recommends using SOCK_SEQPACKET
Since Linux 2.6.4 the SOCK_SEQPACKET socket type is available for UNIX domain sockets on Linux. It is intended for; "a sequenced-packet socket that is connection-oriented, preserves message boundaries, and delivers messages in the order that they were sent." which sounds like us. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
@@ -444,7 +444,7 @@ int api_init(uev_ctx_t *ctx)
|
||||
};
|
||||
|
||||
_d("Setting up external API socket ...");
|
||||
sd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0);
|
||||
sd = socket(AF_UNIX, SOCK_SEQPACKET | SOCK_CLOEXEC, 0);
|
||||
if (-1 == sd) {
|
||||
_pe("Failed starting external API socket");
|
||||
return 1;
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ int client_connect(void)
|
||||
.sun_path = INIT_SOCKET,
|
||||
};
|
||||
|
||||
sd = socket(AF_UNIX, SOCK_STREAM, 0);
|
||||
sd = socket(AF_UNIX, SOCK_SEQPACKET, 0);
|
||||
if (-1 == sd)
|
||||
err(1, "Failed creating UNIX domain socket");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user