diff options
author | Kenny Levinsen <kl@kl.wtf> | 2022-02-09 23:21:18 +0100 |
---|---|---|
committer | Kenny Levinsen <kl@kl.wtf> | 2022-02-09 23:22:29 +0100 |
commit | b47c79d73123052b20bc853b544c10274ab29fa6 (patch) | |
tree | 2350f7eb88f282a6357fad054512cc7a2345ec27 /libseat/backend/noop.c | |
parent | 96a5de88595cb8ddc41a4beb72d213d1f8bfdc61 (diff) |
libseat: Use SOCK_CLOEXEC and SOCK_NONBLOCK
This both simplifies our code and fixes an exec fd leak when using
builtin or noop backends.
Diffstat (limited to 'libseat/backend/noop.c')
-rw-r--r-- | libseat/backend/noop.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libseat/backend/noop.c b/libseat/backend/noop.c index 7436c48..f69aac6 100644 --- a/libseat/backend/noop.c +++ b/libseat/backend/noop.c @@ -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; |