1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-19 00:13:33 +00:00

net/libnss-mysql: unbreak build with mysql80/maria105+ (+)

Transfer maintainership vd => fluffy

PR:		269130
Approved by:	vd
This commit is contained in:
Dima Panov 2023-02-01 15:06:35 +03:00
parent 7c2377dbfc
commit 1709b49e19
3 changed files with 36 additions and 1 deletions

View File

@ -4,7 +4,7 @@ PORTREVISION= 5
CATEGORIES= net
MASTER_SITES= SF
MAINTAINER= vd@FreeBSD.org
MAINTAINER= fluffy@FreeBSD.org
COMMENT= NSS module using a MySQL database for backend
WWW= http://libnss-mysql.sourceforge.net/

View File

@ -0,0 +1,22 @@
--- src/mysql.c.orig 2005-09-04 03:34:02 UTC
+++ src/mysql.c
@@ -196,6 +196,7 @@ _nss_mysql_connect_sql (MYSQL_RES **mresult)
int retval;
sql_server_t *server = &conf.sql.server;
unsigned int port;
+ my_bool reconnect = 1;
DENTER
@@ -238,8 +239,9 @@ _nss_mysql_connect_sql (MYSQL_RES **mresult)
DSRETURN (NSS_UNAVAIL)
}
ci.valid = ntrue;
- ci.link.reconnect = 0; /* Safety: We can't let MySQL assume socket is
- still valid; see _nss_mysql_validate_socket */
+ /* Safety: We can't let MySQL assume socket is still valid;
+ see _nss_mysql_validate_socket */
+ mysql_options(&ci.link, MYSQL_OPT_RECONNECT, &reconnect);
DSRETURN (NSS_SUCCESS)
}
_nss_mysql_log (LOG_ALERT, "Connection to server '%s' failed: %s",

View File

@ -0,0 +1,13 @@
--- src/nss_mysql.h.orig 2005-09-04 03:34:02 UTC
+++ src/nss_mysql.h
@@ -72,6 +72,10 @@ typedef nss_status_t NSS_STATUS;
/* Default initializers */
#define DEF_TIMEOUT 3
+#if !defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 80001
+#define my_bool bool
+#endif
+
#ifdef DEBUG
void _nss_mysql_debug (char *fmt, ...);
#define DEBUG_FILE "/tmp/libnss-mysql-debug.log"