Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Enable use of closefrom() and eaccess() shims.
Landon Fuller committed 11 years ago
commit 6c8f7a25b3c78ce3455cec1a9a4b066d31dd1160
parent 2e79c15
5 files changed +17 -1
modified compat/Makefile.am
@@ -2,6 +2,7 @@ noinst_LTLIBRARIES= libbsd_compat.la
noinst_HEADERS=		bsd_compat.h

libbsd_compat_la_SOURCES=	basename.c \
+
				closefrom.c \
				dirname.c \
				file_at.c \
				gr_util.c \
modified compat/bsd_compat.h
@@ -30,10 +30,15 @@
#include <sys/stat.h>

#include "pkg_config.h"
+
#include "endian_util.h"

char *bsd_dirname(const char *);
char *bsd_basename(const char *);

+
#if !HAVE_EACCESS
+
#define eaccess(_p, _m) access(_p, _m)
+
#endif
+

#if !HAVE_GR_MAKE
#include "gr_util.h"
#endif
@@ -42,7 +47,11 @@ char *bsd_basename(const char *);
#include "humanize_number.h"
#endif

-
#if !HAVE_FSTATAT || !HAVE_OPENAT || !HAVE_UNLINKAT
+
#if !HAVE_CLOSEFROM
+
void closefrom(int lowfd);
+
#endif
+

+
#if !HAVE_FSTATAT || !HAVE_OPENAT || !HAVE_UNLINKAT || !HAVE_FACCESSAT || !HAVE_READLINKAT
#define AT_FDCWD		-100
#endif

modified libpkg/pkg_status.c
@@ -33,6 +33,8 @@

#include <sqlite3.h>

+
#include <bsd_compat.h>
+

#include "pkg.h"


modified libpkg/pkgdb.c
@@ -55,6 +55,8 @@

#include <sqlite3.h>

+
#include <bsd_compat.h>
+

#include "pkg.h"
#include "private/event.h"
#include "private/pkg.h"
modified libpkg/utils.c
@@ -50,6 +50,8 @@
#include <float.h>
#include <math.h>

+
#include <bsd_compat.h>
+

#include "pkg.h"
#include "private/event.h"
#include "private/utils.h"