only create fd handler for wl clipboard data source if fd is passed
authorMike Blumenkrantz <zmike@osg.samsung.com>
Tue, 11 Aug 2015 19:27:00 +0000 (15:27 -0400)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Tue, 11 Aug 2015 20:04:36 +0000 (16:04 -0400)
src/bin/e_comp_wl_data.c

index 9831d52..3c2ad61 100644 (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;