only create fd handler for wl clipboard data source if fd is passed

This commit is contained in:
Mike Blumenkrantz 2015-08-11 15:27:00 -04:00
parent ebc6c0ee35
commit 11e374ce13
1 changed files with 8 additions and 5 deletions

View File

@ -890,11 +890,14 @@ e_comp_wl_clipboard_source_create(const char *mime_type, uint32_t serial, int fd
eina_list_append(source->data_source.mime_types,
eina_stringshare_add(mime_type));
source->fd_handler =
ecore_main_fd_handler_add(fd, ECORE_FD_READ,
_e_comp_wl_clipboard_source_save,
e_comp->wl_comp_data, NULL, NULL);
if (!source->fd_handler) return NULL;
if (fd > 0)
{
source->fd_handler =
ecore_main_fd_handler_add(fd, ECORE_FD_READ,
_e_comp_wl_clipboard_source_save,
e_comp->wl_comp_data, NULL, NULL);
if (!source->fd_handler) return NULL;
}
source->fd = fd;