libseat: Use SOCK_CLOEXEC and SOCK_NONBLOCK
This both simplifies our code and fixes an exec fd leak when using builtin or noop backends.
This commit is contained in:
parent
96a5de8859
commit
b47c79d731
2 changed files with 3 additions and 19 deletions
|
@ -109,7 +109,7 @@ static struct libseat *noop_open_seat(const struct libseat_seat_listener *listen
|
|||
return NULL;
|
||||
}
|
||||
|
||||
if (socketpair(AF_UNIX, SOCK_STREAM, 0, backend->sockets) != 0) {
|
||||
if (socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, backend->sockets) != 0) {
|
||||
log_errorf("socketpair() failed: %s", strerror(errno));
|
||||
free(backend);
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue