[PATCH weston] weston-editor: Close the data source after sending

Yong Bakos junk at humanoriented.com
Sat Jul 9 19:08:53 UTC 2016


On Jul 7, 2016, at 8:52 AM, Derek Foreman <derekf at osg.samsung.com> wrote:
> 
> We're leaking the fd when sending cut'n'paste.  Failure to close can also
> makes the other end unhappy because it doesn't know the paste is finished.
> 
> Signed-off-by: Derek Foreman <derekf at osg.samsung.com>

Occurrences in other weston clients already mimc this patch in a similar
fashion, so this is

Reviewed-by: Yong Bakos <ybakos at humanoriented.com>

Regards,
yong


> ---
> clients/editor.c | 2 ++
> 1 file changed, 2 insertions(+)
> 
> diff --git a/clients/editor.c b/clients/editor.c
> index e081a5b..9daa77f 100644
> --- a/clients/editor.c
> +++ b/clients/editor.c
> @@ -575,6 +575,8 @@ data_source_send(void *data,
> 
> 	if (write(fd, editor->selected_text, strlen(editor->selected_text) + 1) < 0)
> 		fprintf(stderr, "write failed: %m\n");
> +
> +	close(fd);
> }
> 
> static void
> -- 
> 2.8.1
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/wayland-devel



More information about the wayland-devel mailing list