net/wmping: fix the port's build against -fno-common

Ensure that there is only one variable definition per each object, as
the C (and C++) standards mandated for years and compilers started to
enforce as of recently (Clang 11, GCC 10).

While here, define LICENSE, add missing USE_XORG components, and fix
-Wformat-security warnings, adding newline to printed error messages
for clarity and better look.

PR:	267587
This commit is contained in:
Robert Clausecker 2022-11-07 08:01:32 +00:00 committed by Alexey Dokuchaev
parent 968b5605bb
commit 14df860062
4 changed files with 63 additions and 4 deletions

View File

@ -1,6 +1,6 @@
PORTNAME= wmping
PORTVERSION= 0.2.1
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= net windowmaker
MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION}
@ -8,11 +8,11 @@ MAINTAINER= serg@cad.kiev.ua
COMMENT= Windowmaker dock app to display network hosts status
WWW= https://sourceforge.net/projects/wmping/
BROKEN_FreeBSD_13= ld: error: duplicate symbol: display
BROKEN_FreeBSD_14= ld: error: duplicate symbol: display
LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/COPYING
USES= gmake xorg
USE_XORG= xpm
USE_XORG= x11 xext xpm
GNU_CONFIGURE= yes
PORTDOCS= BUGS CHANGES README TODO

View File

@ -0,0 +1,10 @@
--- wmgeneral.c.orig 2003-12-02 16:45:19 UTC
+++ wmgeneral.c
@@ -55,6 +55,7 @@
/* X11 Variables */
/*****************/
+Display *display;
Window Root;
int screen;
int x_fd;

View File

@ -0,0 +1,11 @@
--- wmgeneral.h.orig 2003-12-02 16:45:19 UTC
+++ wmgeneral.h
@@ -36,7 +36,7 @@ typedef struct {
/* Global variable */
/*******************/
-Display *display;
+extern Display *display;
/***********************/
/* Function Prototypes */

View File

@ -0,0 +1,38 @@
--- wmping.c.orig 2004-02-09 09:27:38 UTC
+++ wmping.c
@@ -237,7 +237,7 @@ void readconf()
if(strcmp(tokens[1],"="))
{
sprintf(str_err, "Not correct format of configuration file ( %s ): line %u", cfgfile, lineN);
- fprintf(stderr, str_err);
+ fprintf(stderr, "%s\n", str_err);
exit(-1);
}
@@ -288,7 +288,7 @@ void readconf()
else
{
sprintf(str_err, "Not correct format of configuration file ( %s ): line %u", cfgfile, lineN);
- fprintf(stderr, str_err);
+ fprintf(stderr, "%s\n", str_err);
exit(-1);
}
@@ -297,7 +297,7 @@ void readconf()
else
{
sprintf(str_err, "Error open configuration file ( %s ): %s", cfgfile, strerror(errno));
- fprintf(stderr, str_err);
+ fprintf(stderr, "%s\n", str_err);
fprintf(stderr, "\n Create default configuration file\n");
createDefaultCfg(cfgfile);
}
@@ -305,7 +305,7 @@ void readconf()
else
{
sprintf(str_err, "Error open configuration file ( %s ): %s", cfgfile, strerror(errno));
- fprintf(stderr, str_err);
+ fprintf(stderr, "%s\n", str_err);
fprintf(stderr, "\n Create default configuration file\n");
createDefaultCfg(cfgfile);
}