1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-22 04:17:44 +00:00

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/
This commit is contained in:
Eugene Grosbein 2020-08-27 13:14:31 +00:00
parent a76f4ed38a
commit 2c8b77a0a4
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=546343
2 changed files with 52 additions and 1 deletions

View File

@ -3,7 +3,7 @@
PORTNAME= mpd
DISTVERSION= 5.8
PORTREVISION= 10
PORTREVISION= 11
CATEGORIES= net
MASTER_SITES= SF/${PORTNAME}/Mpd5/Mpd-${PORTVERSION}
PKGNAMESUFFIX= 5

View File

@ -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 <stdio.h>
+
/*
* 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 )