summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/connman/connman/0002-storage.c-If-there-is-no-d_type-support-use-fstatat.patch
diff options
context:
space:
mode:
authorAndrei Gherzan <andrei@gherzan.ro>2012-07-17 13:39:26 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-07-19 16:18:10 (GMT)
commit9d8387170ca37561ba1bedfa73b2b3eaf5f8c6bf (patch)
treee33a7e5fb3204b396c95e0c24603ac3ecf977cfc /meta/recipes-connectivity/connman/connman/0002-storage.c-If-there-is-no-d_type-support-use-fstatat.patch
parent8e0f5026fd659e4fc718b8140f01716a4a3294bb (diff)
downloadpoky-9d8387170ca37561ba1bedfa73b2b3eaf5f8c6bf.tar.gz
connman: Add patches to fix connman on fs with no d_type support
When there is not d_type avalaible on filesystem, fstatat (stat) can be used to check if the path is a directory. storage.c and timezone.c were modified accordingly. (From OE-Core rev: 09203299c666791ce35d5a897fd1aa2b0d281dd6) Signed-off-by: Andrei Gherzan <andrei.gherzan@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity/connman/connman/0002-storage.c-If-there-is-no-d_type-support-use-fstatat.patch')
-rw-r--r--meta/recipes-connectivity/connman/connman/0002-storage.c-If-there-is-no-d_type-support-use-fstatat.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/connman/connman/0002-storage.c-If-there-is-no-d_type-support-use-fstatat.patch b/meta/recipes-connectivity/connman/connman/0002-storage.c-If-there-is-no-d_type-support-use-fstatat.patch
new file mode 100644
index 0000000..d3205c0
--- /dev/null
+++ b/meta/recipes-connectivity/connman/connman/0002-storage.c-If-there-is-no-d_type-support-use-fstatat.patch
@@ -0,0 +1,49 @@
1From 7007ef32a959ac4717c19339a24fd90a68638a19 Mon Sep 17 00:00:00 2001
2From: Andrei Gherzan <andrei@gherzan.ro>
3Date: Tue, 17 Jul 2012 16:07:17 +0300
4Subject: [PATCH V3 2/2] storage.c: If there is no d_type support use
5 fstatat()
6
7This is useful for filesystems where d_type is always DT_UNKNOWN.
8In this case use fstatat() function.
9
10Signed-off-by: Andrei Gherzan <andrei.gherzan@windriver.com>
11Upstream-Status: Submitted
12
13---
14 src/storage.c | 19 +++++++++++++++++++
15 1 file changed, 19 insertions(+)
16
17diff --git a/src/storage.c b/src/storage.c
18index 47bd0cb..0491a52 100644
19--- a/src/storage.c
20+++ b/src/storage.c
21@@ -206,6 +206,25 @@ gchar **connman_storage_get_services()
22
23 g_string_append_printf(result, "%s/", d->d_name);
24 break;
25+ case DT_UNKNOWN:
26+ /*
27+ * If there is no d_type support use fstatat()
28+ * to check if directory
29+ */
30+ ret = fstatat(dirfd(dir), d->d_name, &buf, 0);
31+ if (ret < 0)
32+ continue;
33+ if (!(buf.st_mode & S_IFDIR))
34+ continue;
35+ str = g_strdup_printf("%s/%s/settings", STORAGEDIR,
36+ d->d_name);
37+ ret = stat(str, &buf);
38+ g_free(str);
39+ if (ret < 0)
40+ continue;
41+
42+ g_string_append_printf(result, "%s/", d->d_name);
43+ break;
44 }
45 }
46
47--
481.7.9.5
49