X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=liblttng-sessiond-comm%2Flttng-sessiond-comm.c;h=53e7462b6461c56c2ce690baa8a0d08e75ab0d17;hb=204d45df751cfc84133317c88bc6c46e0de12b52;hp=e370fcd3542b9efddbbf40d90bc904f32264846d;hpb=67c5b804ac870bdc3b262c0cf6cbf117f3e6bc1e;p=lttng-ust.git diff --git a/liblttng-sessiond-comm/lttng-sessiond-comm.c b/liblttng-sessiond-comm/lttng-sessiond-comm.c index e370fcd3..53e7462b 100644 --- a/liblttng-sessiond-comm/lttng-sessiond-comm.c +++ b/liblttng-sessiond-comm/lttng-sessiond-comm.c @@ -117,7 +117,11 @@ int lttcomm_connect_unix_sock(const char *pathname) int fd; int ret; - fd = socket(PF_UNIX, SOCK_STREAM, 0); + /* + * libust threads require the close-on-exec flag for all + * resources so it does not leak file descriptors upon exec. + */ + fd = socket(PF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0); if (fd < 0) { perror("socket"); ret = fd;