mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-06 15:38:53 +00:00
shm: use O_CLOEXEC where appropriate in shmpipe
https://bugzilla.gnome.org/show_bug.cgi?id=684339
This commit is contained in:
parent
b6f50c51f3
commit
c175c6b3d0
1 changed files with 8 additions and 0 deletions
|
@ -759,6 +759,7 @@ sp_client_open (const char *path)
|
||||||
{
|
{
|
||||||
ShmPipe *self = spalloc_new (ShmPipe);
|
ShmPipe *self = spalloc_new (ShmPipe);
|
||||||
struct sockaddr_un sock_un;
|
struct sockaddr_un sock_un;
|
||||||
|
int flags;
|
||||||
|
|
||||||
memset (self, 0, sizeof (ShmPipe));
|
memset (self, 0, sizeof (ShmPipe));
|
||||||
|
|
||||||
|
@ -768,6 +769,13 @@ sp_client_open (const char *path)
|
||||||
if (self->main_socket < 0)
|
if (self->main_socket < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
flags = fcntl (self->main_socket, F_GETFL, 0);
|
||||||
|
if (flags < 0)
|
||||||
|
goto error;
|
||||||
|
|
||||||
|
if (fcntl (self->main_socket, F_SETFL, flags | FD_CLOEXEC) < 0)
|
||||||
|
goto error;
|
||||||
|
|
||||||
sock_un.sun_family = AF_UNIX;
|
sock_un.sun_family = AF_UNIX;
|
||||||
strncpy (sock_un.sun_path, path, sizeof (sock_un.sun_path) - 1);
|
strncpy (sock_un.sun_path, path, sizeof (sock_un.sun_path) - 1);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue