Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
compat: openat is available everywhere
Baptiste Daroussin committed 3 months ago
commit 1909d50ff3427eedad6a15a174b72d5ee22ca223
parent fd612a1
3 files changed +1 -28
modified auto.def
@@ -180,7 +180,7 @@ cc-check-includes stdint.h inttypes.h
cc-check-functions arc4random arc4random_stir chflagsat \
	closefrom fopencookie funopen getprogname \
	strtofflags strtonum utimensat __res_setservers \
-
	fstatat openat readlinkat fflagstostr reallocarray strchrnul \
+
	readlinkat fflagstostr reallocarray strchrnul \
	copy_file_range

cc-with { -includes { libutil.h }} {
modified compat/bsd_compat.h
@@ -104,10 +104,6 @@ void closefrom(int lowfd);
#define	AT_SYMLINK_NOFOLLOW	0x200
#endif

-
#if !HAVE_OPENAT
-
int openat(int fd, const char *path, int flags, ...);
-
#endif
-

#if !HAVE_READLINKAT
ssize_t readlinkat(int fd, const char *restrict path, char *restrict buf, size_t bufsize);
#endif
modified compat/file_at.c
@@ -108,26 +108,3 @@ readlinkat(int fd, const char *restrict path, char *restrict buf,
	return ret;
}
#endif
-

-
#if !HAVE_OPENAT
-
int
-
openat(int fd, const char *path, int flags, ...)
-
{
-
	int ret;
-
	va_list ap;
-

-
	if ((ret = file_chdir_lock(fd) != 0))
-
		return ret;
-

-
	if (flags & O_CREAT) {
-
		va_start(ap, flags);
-
		ret = open(path, flags, va_arg(ap, int));
-
		va_end(ap);
-
	} else {
-
		ret = open(path, flags);
-
	}
-

-
	file_chdir_unlock(fd);
-
	return ret;
-
}
-
#endif