diff --git a/gst/shm/gstshmsink.c b/gst/shm/gstshmsink.c index 03dd3ddcdd..ba8608fa9d 100644 --- a/gst/shm/gstshmsink.c +++ b/gst/shm/gstshmsink.c @@ -195,6 +195,7 @@ gst_shm_sink_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) { GstShmSink *self = GST_SHM_SINK (object); + int ret = 0; switch (prop_id) { case PROP_SOCKET_PATH: @@ -206,8 +207,12 @@ gst_shm_sink_set_property (GObject * object, guint prop_id, case PROP_PERMS: GST_OBJECT_LOCK (object); self->perms = g_value_get_uint (value); - sp_writer_setperms_shm (self->pipe, self->perms); + if (self->pipe) + ret = sp_writer_setperms_shm (self->pipe, self->perms); GST_OBJECT_UNLOCK (object); + if (ret < 0) + GST_WARNING_OBJECT (object, "Could not set permissions on pipe: %s", + strerror (ret)); break; case PROP_SHM_SIZE: GST_OBJECT_LOCK (object); @@ -245,8 +250,14 @@ gst_shm_sink_get_property (GObject * object, guint prop_id, break; case PROP_PERMS: self->perms = g_value_get_uint (value); - if (self->pipe) - sp_writer_setperms_shm (self->pipe, self->perms); + if (self->pipe) { + int ret; + + ret = sp_writer_setperms_shm (self->pipe, self->perms); + if (ret < 0) + GST_WARNING_OBJECT (object, "Could not set permissions on pipe: %s", + strerror (ret)); + } break; case PROP_SHM_SIZE: g_value_set_uint (value, self->size); diff --git a/gst/shm/shmpipe.c b/gst/shm/shmpipe.c index 169600cd79..53fc6df8a0 100644 --- a/gst/shm/shmpipe.c +++ b/gst/shm/shmpipe.c @@ -371,11 +371,11 @@ sp_close (ShmPipe * self) spalloc_free (ShmPipe, self); } -void +int sp_writer_setperms_shm (ShmPipe * self, mode_t perms) { self->perms = perms; - fchmod (self->shm_area->shm_fd, perms); + return fchmod (self->shm_area->shm_fd, perms); } static int diff --git a/gst/shm/shmpipe.h b/gst/shm/shmpipe.h index ed23d20b20..f3657b6769 100644 --- a/gst/shm/shmpipe.h +++ b/gst/shm/shmpipe.h @@ -50,7 +50,7 @@ ShmPipe *sp_writer_create (const char *path, size_t size, mode_t perms); const char *sp_writer_get_path (ShmPipe *pipe); void sp_close (ShmPipe * self); -void sp_writer_setperms_shm (ShmPipe * self, mode_t perms); +int sp_writer_setperms_shm (ShmPipe * self, mode_t perms); int sp_writer_resize (ShmPipe * self, size_t size); int sp_get_fd (ShmPipe * self);