Skip to content

Commit 167d59b

Browse files
committed
lib: don't check for dup3 support - it has been around a long time
dup3() was introduced in Linux 2.6.27 and glibc 2.9. Signed-off-by: Quentin Armitage <[email protected]>
1 parent e489af3 commit 167d59b

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

configure.ac

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,8 +1380,7 @@ AC_FUNC_FORK
13801380
# We add malloc and realloc to AC_CHECK_FUNCS instead.
13811381
#AC_FUNC_MALLOC
13821382
#AC_FUNC_REALLOC
1383-
dnl - dup3 since Linux 2.6.27 and glibc 2.9
1384-
AC_CHECK_FUNCS([dup2 dup3 getcwd gettimeofday malloc memmove memset realloc select setenv socket strcasecmp strchr strdup strerror strpbrk strstr strtol strtoul uname])
1383+
AC_CHECK_FUNCS([getcwd gettimeofday malloc memmove memset realloc select setenv socket strcasecmp strchr strdup strerror strpbrk strstr strtol strtoul uname])
13851384
dnl - vsyslog() Not defined by Posix, but available in glibc and musl
13861385
AC_CHECK_FUNCS([vsyslog], [add_system_opt([VSYSLOG])])
13871386

lib/parser.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3460,11 +3460,7 @@ separate_config_file(void)
34603460
log_message(LOG_INFO, "Failed to open %s for conf_copy", buf);
34613461
return;
34623462
}
3463-
#ifdef HAVE_DUP3
3463+
34643464
dup3(fd, fd_orig, O_CLOEXEC);
3465-
#else
3466-
dup2(fd, fd_orig);
3467-
fcntl(fd_orig, F_SETFD, fcntl(fd_orig, F_GETFD) | FD_CLOEXEC);
3468-
#endif
34693465
close(fd);
34703466
}

0 commit comments

Comments
 (0)