diff options
Diffstat (limited to 'meta/recipes-extended/minicom/minicom/0003-Drop-superfluous-global-variable-definitions.patch')
-rw-r--r-- | meta/recipes-extended/minicom/minicom/0003-Drop-superfluous-global-variable-definitions.patch | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/meta/recipes-extended/minicom/minicom/0003-Drop-superfluous-global-variable-definitions.patch b/meta/recipes-extended/minicom/minicom/0003-Drop-superfluous-global-variable-definitions.patch new file mode 100644 index 0000000000..58cd58eda8 --- /dev/null +++ b/meta/recipes-extended/minicom/minicom/0003-Drop-superfluous-global-variable-definitions.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | From a4fc603b3641d2efe31479116eb7ba66932901c7 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= <olysonek@redhat.com> | ||
3 | Date: Mon, 3 Feb 2020 13:21:41 +0100 | ||
4 | Subject: [PATCH 3/3] Drop superfluous global variable definitions | ||
5 | |||
6 | The only place where the EXTERN macro mechanism is used to define the | ||
7 | global variables 'portfd_is_socket', 'portfd_is_connected' and | ||
8 | 'portfd_sock_addr' is minicom.c (by defining an empty EXTERN macro and | ||
9 | including the minicom.h header). The source file sysdep1_s.c already | ||
10 | defines these variables. The sysdep1_s.o object file is always linked | ||
11 | to minicom.o. Thus it is safe to drop the definitions from minicom.c | ||
12 | and only declare the variables in the minicom.h header. | ||
13 | |||
14 | This fixes linking with gcc 10 which uses -fno-common by default, | ||
15 | disallowing multiple global variable definitions. | ||
16 | |||
17 | Upstream-Status: Pending | ||
18 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
19 | --- | ||
20 | src/minicom.h | 6 +++--- | ||
21 | 1 file changed, 3 insertions(+), 3 deletions(-) | ||
22 | |||
23 | diff --git a/src/minicom.h b/src/minicom.h | ||
24 | index 0f9693b..1e7cb8c 100644 | ||
25 | --- a/src/minicom.h | ||
26 | +++ b/src/minicom.h | ||
27 | @@ -113,9 +113,9 @@ EXTERN char *dial_user; /* Our username there */ | ||
28 | EXTERN char *dial_pass; /* Our password */ | ||
29 | |||
30 | #ifdef USE_SOCKET | ||
31 | -EXTERN int portfd_is_socket; /* File descriptor is a unix socket */ | ||
32 | -EXTERN int portfd_is_connected; /* 1 if the socket is connected */ | ||
33 | -EXTERN struct sockaddr_un portfd_sock_addr; /* the unix socket address */ | ||
34 | +extern int portfd_is_socket; /* File descriptor is a unix socket */ | ||
35 | +extern int portfd_is_connected; /* 1 if the socket is connected */ | ||
36 | +extern struct sockaddr_un portfd_sock_addr; /* the unix socket address */ | ||
37 | #define portfd_connected ((portfd_is_socket && !portfd_is_connected) \ | ||
38 | ? -1 : portfd) | ||
39 | #else | ||
40 | -- | ||
41 | 2.24.1 | ||
42 | |||