From 2c8b77a0a41a2b3eef64beb6429feb32e99d3cd7 Mon Sep 17 00:00:00 2001 From: Eugene Grosbein Date: Thu, 27 Aug 2020 13:14:31 +0000 Subject: [PATCH] net/mpd5: improve logging in rare case of libpdel failure. Import upstream r2329 and r2373 to direct assertion message to the log. See also: https://sourceforge.net/p/mpd/bugs/68/ --- net/mpd5/Makefile | 2 +- net/mpd5/files/patch-write-abortmsg | 51 +++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 net/mpd5/files/patch-write-abortmsg diff --git a/net/mpd5/Makefile b/net/mpd5/Makefile index 6551d7ce907c..95e6845e5344 100644 --- a/net/mpd5/Makefile +++ b/net/mpd5/Makefile @@ -3,7 +3,7 @@ PORTNAME= mpd DISTVERSION= 5.8 -PORTREVISION= 10 +PORTREVISION= 11 CATEGORIES= net MASTER_SITES= SF/${PORTNAME}/Mpd5/Mpd-${PORTVERSION} PKGNAMESUFFIX= 5 diff --git a/net/mpd5/files/patch-write-abortmsg b/net/mpd5/files/patch-write-abortmsg new file mode 100644 index 000000000000..b0c2fc05836c --- /dev/null +++ b/net/mpd5/files/patch-write-abortmsg @@ -0,0 +1,51 @@ +Index: src/log.h +=================================================================== +--- src/log.h (revision 2328) ++++ src/log.h (revision 2329) +@@ -14,6 +14,10 @@ + #ifndef _LG_H_ + #define _LG_H_ + ++#include "mbuf.h" ++ ++#include ++ + /* + * DEFINITIONS + */ +Index: src/contrib/libpdel/util/gtree.c +=================================================================== +--- src/contrib/libpdel/util/gtree.c (revision 2372) ++++ src/contrib/libpdel/util/gtree.c (revision 2373) +@@ -58,6 +58,9 @@ + #include "util/gtree.h" + #include "util/typed_mem.h" + ++#include "defs.h" ++#include "log.h" ++ + /* Enabled debug tracing: only use this when keys are strings */ + #define GTREE_TRACE 0 + +@@ -1091,7 +1094,7 @@ gtree_assert(int pred, const char *s, co + { + if (pred) + return; +- printf("FAILURE: %s:%u: %s\n", func, line, s); ++ Perror("FAILURE: %s:%u: %s\n", func, line, s); + gtree_print(g, stdout); + kill(getpid(), SIGABRT); + } +Index: src/Makefile +=================================================================== +--- src/Makefile (revision 2372) ++++ src/Makefile (revision 2373) +@@ -162,7 +162,7 @@ STDSRCS+= web.c + LDADD+= -lssl + .endif + +-CFLAGS+= -DNOLIBPDEL -I./contrib/libpdel ++CFLAGS+= -DNOLIBPDEL -I. -I./contrib/libpdel + PDPATH1= contrib/libpdel/util:contrib/libpdel/structs + PDPATH2= contrib/libpdel/structs/type + .if defined ( NOWEB )