diff options
| author | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2007-05-18 16:00:34 +0000 | 
|---|---|---|
| committer | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2007-05-18 16:00:34 +0000 | 
| commit | d421185c6b67a294980425dd24d8142956bb7124 (patch) | |
| tree | 927261fb593fa5f8988b9b2ebc65a2732b38e5d2 | |
| parent | f7544168a7628f67f98da7a7d6db63678a3d9be3 (diff) | |
serial: eglib build was broken
| -rw-r--r-- | serial/manager.c | 25 | ||||
| -rw-r--r-- | 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 <unistd.h>  #include <sys/stat.h> +#include <sys/param.h>  #include <bluetooth/bluetooth.h> | 
