Blame SOURCES/0003-Drop-superfluous-global-variable-definitions.patch

3f7af7
From a4fc603b3641d2efe31479116eb7ba66932901c7 Mon Sep 17 00:00:00 2001
3f7af7
From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= <olysonek@redhat.com>
3f7af7
Date: Mon, 3 Feb 2020 13:21:41 +0100
3f7af7
Subject: [PATCH 3/3] Drop superfluous global variable definitions
3f7af7
3f7af7
The only place where the EXTERN macro mechanism is used to define the
3f7af7
global variables 'portfd_is_socket', 'portfd_is_connected' and
3f7af7
'portfd_sock_addr' is minicom.c (by defining an empty EXTERN macro and
3f7af7
including the minicom.h header). The source file sysdep1_s.c already
3f7af7
defines these variables. The sysdep1_s.o object file is always linked
3f7af7
to minicom.o. Thus it is safe to drop the definitions from minicom.c
3f7af7
and only declare the variables in the minicom.h header.
3f7af7
3f7af7
This fixes linking with gcc 10 which uses -fno-common by default,
3f7af7
disallowing multiple global variable definitions.
3f7af7
---
3f7af7
 src/minicom.h | 6 +++---
3f7af7
 1 file changed, 3 insertions(+), 3 deletions(-)
3f7af7
3f7af7
diff --git a/src/minicom.h b/src/minicom.h
3f7af7
index 0f9693b..1e7cb8c 100644
3f7af7
--- a/src/minicom.h
3f7af7
+++ b/src/minicom.h
3f7af7
@@ -113,9 +113,9 @@ EXTERN char *dial_user;     /* Our username there */
3f7af7
 EXTERN char *dial_pass;     /* Our password */
3f7af7
 
3f7af7
 #ifdef USE_SOCKET
3f7af7
-EXTERN int portfd_is_socket;	/* File descriptor is a unix socket */
3f7af7
-EXTERN int portfd_is_connected;	/* 1 if the socket is connected */
3f7af7
-EXTERN struct sockaddr_un portfd_sock_addr;	/* the unix socket address */
3f7af7
+extern int portfd_is_socket;	/* File descriptor is a unix socket */
3f7af7
+extern int portfd_is_connected;	/* 1 if the socket is connected */
3f7af7
+extern struct sockaddr_un portfd_sock_addr;	/* the unix socket address */
3f7af7
 #define portfd_connected ((portfd_is_socket && !portfd_is_connected) \
3f7af7
                            ? -1 : portfd)
3f7af7
 #else
3f7af7
-- 
3f7af7
2.24.1
3f7af7