]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/dt-utils/0001-common-Rename-strlcpy-to-DT_strlcpy.patch
janus-gateway: rename options to have proper prefix
[coffee/buildroot.git] / package / dt-utils / 0001-common-Rename-strlcpy-to-DT_strlcpy.patch
1 From 3d229cc0f8dc81335c53b1f7471ef82ef2f6e570 Mon Sep 17 00:00:00 2001
2 From: Marcin Niestroj <m.niestroj@grinn-global.com>
3 Date: Fri, 23 Jun 2017 11:11:04 +0200
4 Subject: [PATCH] common: Rename strlcpy to DT_strlcpy
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 strlcpy function is defined in uClibc library, causing "static
10 declaration of ‘strlcpy’ follows non-static declaration" build
11 errors.
12
13 Rename internal strlcpy function to DT_strlcpy to avoid conflicts.
14
15 Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
16 ---
17  src/dt/common.h | 4 ++--
18  src/libdt.c     | 2 +-
19  2 files changed, 3 insertions(+), 3 deletions(-)
20
21 diff --git a/src/dt/common.h b/src/dt/common.h
22 index f6bad44..992e28f 100644
23 --- a/src/dt/common.h
24 +++ b/src/dt/common.h
25 @@ -168,7 +168,7 @@ static inline char *barebox_asprintf(const char *fmt, ...)
26  #define basprintf(fmt, arg...) barebox_asprintf(fmt, ##arg)
27  
28  /**
29 - * strlcpy - Copy a %NUL terminated string into a sized buffer
30 + * DT_strlcpy - Copy a %NUL terminated string into a sized buffer
31   * @dest: Where to copy the string to
32   * @src: Where to copy the string from
33   * @size: size of destination buffer
34 @@ -178,7 +178,7 @@ static inline char *barebox_asprintf(const char *fmt, ...)
35   * of course, the buffer size is zero). It does not pad
36   * out the result like strncpy() does.
37   */
38 -static inline size_t strlcpy(char *dest, const char *src, size_t size)
39 +static inline size_t DT_strlcpy(char *dest, const char *src, size_t size)
40  {
41         size_t ret = strlen(src);
42  
43 diff --git a/src/libdt.c b/src/libdt.c
44 index 4db5160..3adeed2 100644
45 --- a/src/libdt.c
46 +++ b/src/libdt.c
47 @@ -1503,7 +1503,7 @@ int of_modalias_node(struct device_node *node, char *modalias, int len)
48         if (!compatible || strlen(compatible) > cplen)
49                 return -ENODEV;
50         p = strchr(compatible, ',');
51 -       strlcpy(modalias, p ? p + 1 : compatible, len);
52 +       DT_strlcpy(modalias, p ? p + 1 : compatible, len);
53         return 0;
54  }
55  
56 -- 
57 2.13.1
58