]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Work around nl_socket_set_nonblocking on Android
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 7 Nov 2013 14:02:23 +0000 (16:02 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 7 Nov 2013 15:10:34 +0000 (17:10 +0200)
system/core/libnl_2 does not include nl_socket_set_nonblocking(), so
need to implement that to fix the build.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

src/drivers/driver_nl80211.c

index 4dffb3eb00e8890adae414cfb1d5c554247aeb97..a8055e69984b4c43196834c82b8f7c47c9adff27 100644 (file)
@@ -109,6 +109,17 @@ static void nl80211_handle_destroy(struct nl_handle *handle)
 #endif /* CONFIG_LIBNL20 */
 
 
+#ifdef ANDROID
+/* system/core/libnl_2 does not include nl_socket_set_nonblocking() */
+static int android_nl_socket_set_nonblocking(struct nl_handle *handle)
+{
+       return fcntl(nl_socket_get_fd(handle), F_SETFL, O_NONBLOCK);
+}
+#undef nl_socket_set_nonblocking
+#define nl_socket_set_nonblocking(h) android_nl_socket_set_nonblocking(h)
+#endif /* ANDROID */
+
+
 static struct nl_handle * nl_create_handle(struct nl_cb *cb, const char *dbg)
 {
        struct nl_handle *handle;