From d421185c6b67a294980425dd24d8142956bb7124 Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Fri, 18 May 2007 16:00:34 +0000 Subject: serial: eglib build was broken --- serial/manager.c | 25 +++++++++++++------------ serial/storage.c | 1 + 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/serial/manager.c b/serial/manager.c index bd0362df..b860659d 100644 --- a/serial/manager.c +++ b/serial/manager.c @@ -144,6 +144,16 @@ static struct pending_connect *find_pending_connect_by_pattern(const char *bda, return NULL; } +static void open_context_free(void *data) +{ + struct open_context *oc = data; + + if (oc->ufree) + oc->ufree(oc->udata); + g_free(oc->dev); + g_free(oc); +} + static gboolean open_continue(struct open_context *oc) { int fd; @@ -156,25 +166,17 @@ static gboolean open_continue(struct open_context *oc) if (++oc->ntries >= MAX_OPEN_TRIES) { /* Reporting error */ oc->notify(fd, err, oc->udata); + open_context_free(oc); return FALSE; } return TRUE; } /* Connection succeeded */ oc->notify(fd, 0, oc->udata); + open_context_free(oc); return FALSE; } -static void open_context_free(void *data) -{ - struct open_context *oc = data; - - if (oc->ufree) - oc->ufree(oc->udata); - g_free(oc->dev); - g_free(oc); -} - int port_open(const char *dev, open_notify_t notify, void *udata, udata_free_t ufree) { @@ -188,8 +190,7 @@ int port_open(const char *dev, open_notify_t notify, oc->notify = notify; oc->ufree = ufree; oc->udata = udata; - g_timeout_add_full(G_PRIORITY_DEFAULT_IDLE, OPEN_WAIT, - (GSourceFunc) open_continue, oc, open_context_free); + g_timeout_add(OPEN_WAIT, (GSourceFunc) open_continue, oc); return -EINPROGRESS; } diff --git a/serial/storage.c b/serial/storage.c index 0b599247..89d156e5 100644 --- a/serial/storage.c +++ b/serial/storage.c @@ -27,6 +27,7 @@ #include #include +#include #include -- cgit