blob: 58cd58eda8b03f7667db4dc42c2184b01ea7f6c8 [file] [log] [blame]
Andrew Geissler635e0e42020-08-21 15:58:33 -05001From a4fc603b3641d2efe31479116eb7ba66932901c7 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= <olysonek@redhat.com>
3Date: Mon, 3 Feb 2020 13:21:41 +0100
4Subject: [PATCH 3/3] Drop superfluous global variable definitions
5
6The only place where the EXTERN macro mechanism is used to define the
7global variables 'portfd_is_socket', 'portfd_is_connected' and
8'portfd_sock_addr' is minicom.c (by defining an empty EXTERN macro and
9including the minicom.h header). The source file sysdep1_s.c already
10defines these variables. The sysdep1_s.o object file is always linked
11to minicom.o. Thus it is safe to drop the definitions from minicom.c
12and only declare the variables in the minicom.h header.
13
14This fixes linking with gcc 10 which uses -fno-common by default,
15disallowing multiple global variable definitions.
16
17Upstream-Status: Pending
18Signed-off-by: Khem Raj <raj.khem@gmail.com>
19---
20 src/minicom.h | 6 +++---
21 1 file changed, 3 insertions(+), 3 deletions(-)
22
23diff --git a/src/minicom.h b/src/minicom.h
24index 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--
412.24.1
42