[weston,v2] clipboard: set fd member of clipboard_source

Submitted by Marek Chalupa on Dec. 10, 2014, 11:07 a.m.

Details

Message ID 1418209678-2848-1-git-send-email-mchqwerty@gmail.com
State Accepted
Commit 389a10d705bd9999a925061c10efd06bbecc8c80
Headers show

Not browsing as part of any series.

Commit Message

Marek Chalupa Dec. 10, 2014, 11:07 a.m.
The fd member of clipboard_source structure was not set
but was used in close().

v2. don't do unnecessary changes

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
---
 src/clipboard.c | 1 +
 1 file changed, 1 insertion(+)

Patch hide | download patch | download mbox

diff --git a/src/clipboard.c b/src/clipboard.c
index dbd8c9b..c1091a9 100644
--- a/src/clipboard.c
+++ b/src/clipboard.c
@@ -151,6 +151,7 @@  clipboard_source_create(struct clipboard *clipboard,
 	source->refcount = 1;
 	source->clipboard = clipboard;
 	source->serial = serial;
+	source->fd = fd;
 
 	s = wl_array_add(&source->base.mime_types, sizeof *s);
 	if (s == NULL)

Comments

On Wed, 10 Dec 2014 12:07:58 +0100
Marek Chalupa <mchqwerty@gmail.com> wrote:

> The fd member of clipboard_source structure was not set
> but was used in close().
> 
> v2. don't do unnecessary changes
> 
> Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
> ---
>  src/clipboard.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/clipboard.c b/src/clipboard.c
> index dbd8c9b..c1091a9 100644
> --- a/src/clipboard.c
> +++ b/src/clipboard.c
> @@ -151,6 +151,7 @@ clipboard_source_create(struct clipboard *clipboard,
>  	source->refcount = 1;
>  	source->clipboard = clipboard;
>  	source->serial = serial;
> +	source->fd = fd;
>  
>  	s = wl_array_add(&source->base.mime_types, sizeof *s);
>  	if (s == NULL)

Nice find. I suppose this would have been a problem only if a client
exited in the middle of a clipboard data transfer (read error), and so
it went unnoticed.

Pushed, thanks,
pq