Build Breakage
Rémi Denis-Courmont
remi at remlab.net
Thu Aug 20 00:54:05 PDT 2009
On Wed, 19 Aug 2009 19:59:37 -0500, Denis Kenzior <denkenz at gmail.com>
wrote:
> The latest gisi changes break the build:
>
> pep.c: In function ‘g_isi_pep_create’:
> pep.c:80: error: ‘SOCK_NONBLOCK’ undeclared (first use in this
> function)
> pep.c:80: error: (Each undeclared identifier is reported only once
> pep.c:80: error: for each function it appears in.)
> pep.c:80: error: ‘SOCK_CLOEXEC’ undeclared (first use in this
> function)
> make[2]: *** [pep.lo] Error 1
> make[1]: *** [all-recursive] Error 1
>
> SOCK_NONBLOCK and SOCK_CLOEXEC are only available on kernel >= 2.6.28 &
> glibc >= 2.9.
Attached patch should fix it.
--
Rémi Denis-Courmont
-------------- next part --------------
From 3ab2402ebc41204a53947aead4739ff92c1d46ff Mon Sep 17 00:00:00 2001
From: =?utf-8?q?R=C3=A9mi=20Denis-Courmont?= <remi.denis-courmont at nokia.com>
Date: Thu, 20 Aug 2009 10:52:57 +0300
Subject: [PATCH] gisi: PEP: use more portable non-blocking and close-on-exec
---
gisi/pep.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/gisi/pep.c b/gisi/pep.c
index 89c6a80..abfe106 100644
--- a/gisi/pep.c
+++ b/gisi/pep.c
@@ -77,10 +77,13 @@ GIsiPEP *g_isi_pep_create(GIsiModem *modem)
unsigned ifi = g_isi_modem_index(modem);
char buf[IF_NAMESIZE];
- fd = socket(PF_PHONET, SOCK_SEQPACKET|SOCK_NONBLOCK|SOCK_CLOEXEC, 0);
+ fd = socket(PF_PHONET, SOCK_SEQPACKET, 0);
if (fd == -1)
return NULL;
+ fcntl(fd, F_SETFD, FD_CLOEXEC);
+ fcntl(fd, F_SETFL, O_NONBLOCK|fcntl(fd, F_GETFL));
+
if (if_indextoname(ifi, buf) == NULL ||
setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, buf, IF_NAMESIZE))
goto error;
--
1.6.0.4
More information about the ofono
mailing list