Skip to content

Commit 5502149

Browse files
committed
Only provide execvpe(3) when needed
Check for the existence of execvpe(3) and only provide the FreeBSD compat version if required. Signed-off-by: Brooks Davis <[email protected]>
1 parent a03ebd9 commit 5502149

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

config/user.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ AC_DEFUN([ZFS_AC_CONFIG_USER], [
3131
ZFS_AC_CONFIG_USER_MAKEDEV_IN_MKDEV
3232
ZFS_AC_CONFIG_USER_ZFSEXEC
3333
34-
AC_CHECK_FUNCS([issetugid mlockall strlcat strlcpy])
34+
AC_CHECK_FUNCS([execvpe issetugid mlockall strlcat strlcpy])
3535
3636
AC_SUBST(RM)
3737
])

lib/libspl/include/os/freebsd/sys/param.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@
5757
extern size_t spl_pagesize(void);
5858
#define PAGESIZE (spl_pagesize())
5959

60+
#ifndef HAVE_EXECVPE
6061
extern int execvpe(const char *name, char * const argv[], char * const envp[]);
62+
#endif
6163

6264
#endif

lib/libzfs/os/freebsd/libzfs_compat.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
#define ZFS_KMOD "openzfs"
3939
#endif
4040

41-
41+
#ifndef HAVE_EXECVPE
42+
/* FreeBSD prior to 15 lacks execvpe */
4243
static int
4344
execvPe(const char *name, const char *path, char * const *argv,
4445
char * const *envp)
@@ -192,6 +193,7 @@ execvpe(const char *name, char * const argv[], char * const envp[])
192193

193194
return (execvPe(name, path, argv, envp));
194195
}
196+
#endif /* !HAVE_EXECVPE */
195197

196198
static __thread char errbuf[ERRBUFLEN];
197199

0 commit comments

Comments
 (0)