commit e2449494107cb1a123cf9f2da35c188815c45f46
parent f920a5dabebd03348b02c5c5362691ec9d189df9
Author: Michael Forney <mforney@mforney.org>
Date: Sat, 10 Aug 2013 13:14:36 -0700
Close data file descriptor upon transfer
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/data.c b/data.c
@@ -26,6 +26,7 @@
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
struct data
{
@@ -53,7 +54,10 @@ static void offer_receive(struct wl_client * client,
/* Protect against expired data_offers being used. */
if (data)
+ {
wl_data_source_send_send(data->source, mime_type, fd);
+ close(fd);
+ }
}
static void offer_destroy(struct wl_client * client,