summaryrefslogtreecommitdiff
path: root/meta-openembedded/meta-oe/recipes-support/zchunk/zchunk/0002-unzck-fix-build-with-musl-libc.patch
blob: a1c95bf362e25cc4f504cac0a4792cbc42885118 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
From 72c55e3da59eccdfea3778d11f83862b58af723d Mon Sep 17 00:00:00 2001
From: Pierre-Jean Texier <pjtexier@koncepto.io>
Date: Thu, 23 Jan 2020 22:42:40 +0100
Subject: [PATCH 2/2] unzck: fix build with musl libc

On musl libc "stdout" is a preprocessor macro whose expansion leads to
compilation errors.

Fixes:

| In file included from ../git/src/unzck.c:31:
| ../git/src/unzck.c: In function 'parse_opt':
| ../git/src/unzck.c:78:24: error: expected identifier before '(' token
|    78 |             arguments->stdout = true;
|       |                        ^~~~~~
| ../git/src/unzck.c: In function 'main':
| ../git/src/unzck.c:141:20: error: expected identifier before '(' token
|   141 |     if(!(arguments.stdout)) {
|       |                    ^~~~~~

Upstream-Status: Submitted [https://github.com/zchunk/zchunk/pull/23]

Signed-off-by: Pierre-Jean Texier <pjtexier@koncepto.io>
---
 src/unzck.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/unzck.c b/src/unzck.c
index 8d6c62a..002492c 100644
--- a/src/unzck.c
+++ b/src/unzck.c
@@ -58,7 +58,7 @@ struct arguments {
   char *args[1];
   zck_log_type log_level;
   bool dict;
-  bool stdout;
+  bool stdOut;
   bool exit;
 };
 
@@ -75,7 +75,7 @@ static error_t parse_opt (int key, char *arg, struct argp_state *state) {
                 arguments->log_level = ZCK_LOG_DDEBUG;
             break;
         case 'c':
-            arguments->stdout = true;
+            arguments->stdOut = true;
             break;
         case 'V':
             version();
@@ -138,7 +138,7 @@ int main (int argc, char *argv[]) {
         snprintf(out_name + strlen(base_name) - 4, 7, ".zdict");
 
     int dst_fd = STDOUT_FILENO;
-    if(!arguments.stdout) {
+    if(!arguments.stdOut) {
         dst_fd = open(out_name, O_TRUNC | O_WRONLY | O_CREAT, 0666);
         if(dst_fd < 0) {
             dprintf(STDERR_FILENO, "Unable to open %s", out_name);
-- 
2.7.4