2013-10-23 08:26:29

by Lukasz Rymanowski

[permalink] [raw]
Subject: [PATCH] android: Fix build error for Android

Android uses functions and defines from sys/capability.h which
requires additional include
---
android/main.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/android/main.c b/android/main.c
index 988d08b..606baf2 100644
--- a/android/main.c
+++ b/android/main.c
@@ -52,6 +52,10 @@
#include "hal-msg.h"
#include "ipc.h"

+#if defined(ANDROID)
+#include <sys/capability.h>
+#endif
+
static GMainLoop *event_loop;
static struct mgmt *mgmt_if = NULL;

--
1.8.4



2013-10-23 09:18:50

by Andrei Emeltchenko

[permalink] [raw]
Subject: Re: [PATCH] android: Fix build error for Android

Hi Lukasz,

On Wed, Oct 23, 2013 at 11:26 AM, Lukasz Rymanowski
<[email protected]> wrote:
> Android uses functions and defines from sys/capability.h which
> requires additional include
> ---
> android/main.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/android/main.c b/android/main.c
> index 988d08b..606baf2 100644
> --- a/android/main.c
> +++ b/android/main.c
> @@ -52,6 +52,10 @@
> #include "hal-msg.h"
> #include "ipc.h"
>
> +#if defined(ANDROID)

check also for platform version in order to compile for 4.2.2

Regards,
Andrei

> +#include <sys/capability.h>
> +#endif
> +
> static GMainLoop *event_loop;
> static struct mgmt *mgmt_if = NULL;
>
> --
> 1.8.4
>
> ---------------------------------------------------------------------
> Intel Finland Oy
> Registered Address: PL 281, 00181 Helsinki
> Business Identity Code: 0357606 - 4
> Domiciled in Helsinki
>
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.
>



--
Best regards,
Andrei Emeltchenko
Intel / OTC / Helsinki

2013-10-23 06:40:26

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH] android: Fix build error for Android

Hi Lukasz,

On Wed, Oct 23, 2013, Lukasz Rymanowski wrote:
> ---
> android/main.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/android/main.c b/android/main.c
> index 988d08b..606baf2 100644
> --- a/android/main.c
> +++ b/android/main.c
> @@ -52,6 +52,10 @@
> #include "hal-msg.h"
> #include "ipc.h"
>
> +#if defined(ANDROID)
> +#include <sys/capability.h>
> +#endif
> +
> static GMainLoop *event_loop;
> static struct mgmt *mgmt_if = NULL;

You're going to have to do a lot more explaining for this one.
Firstly, you should quote the error you get in the commit message.
Secondly, the patch doesn't seem to agree with the subject since the
conditional you're adding shouldn't change anything for the android
build. Thirdly, if there are some quirks with Android (bionic) includes
there should be a proper code comment explaining this so that the piece
of code doesn't by mistake get removed in the future.

Johan