misc/librepo: Fix SEGV by patching sources to make 2 functions be properly declared and called.

This commit is contained in:
Yuri Victorovich 2020-09-27 10:39:06 +00:00
parent f0223d1315
commit ad505c9d58
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=550261
3 changed files with 24 additions and 4 deletions

View file

@ -2,7 +2,7 @@
PORTNAME= librepo
DISTVERSION= 1.12.1
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= misc
MAINTAINER= yuri@FreeBSD.org

View file

@ -1,13 +1,18 @@
https://github.com/rpm-software-management/librepo/issues/200
--- librepo/downloader.c.orig 2020-08-22 20:15:59 UTC
+++ librepo/downloader.c
@@ -18,9 +18,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#define _XOPEN_SOURCE 500 // Because of fdopen() and ftruncate()
-#define _DEFAULT_SOURCE // Because of futimes()
-#define _BSD_SOURCE // Because of futimes()
+#if __FreeBSD__
#define _XOPEN_SOURCE 500 // Because of fdopen() and ftruncate()
#define _DEFAULT_SOURCE // Because of futimes()
#define _BSD_SOURCE // Because of futimes()
+//#define _XOPEN_SOURCE 500 // Because of fdopen() and ftruncate()
+//#define _DEFAULT_SOURCE // Because of futimes()
+//#define _BSD_SOURCE // Because of futimes()
+#endif
#include <glib.h>

View file

@ -0,0 +1,15 @@
Otherwise realpath(3) declaration isn't found: https://github.com/rpm-software-management/librepo/issues/202
--- librepo/yum.c.orig 2020-09-27 10:18:54 UTC
+++ librepo/yum.c
@@ -18,8 +18,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#define _POSIX_SOURCE
-#define _DEFAULT_SOURCE
+//#define _POSIX_SOURCE
+//#define _DEFAULT_SOURCE
#define BITS_IN_BYTE 8
#include <stdio.h>