Compare commits
12 Commits
92662ddc44
...
f1e5510ccf
Author | SHA1 | Date | |
---|---|---|---|
|
f1e5510ccf | ||
|
1b72c3a7ab | ||
|
c4785f1b99 | ||
|
e447562aaa | ||
|
c199c5cf6e | ||
|
5bfb592d75 | ||
|
b2c4eb97b5 | ||
|
e740913fcb | ||
|
1bc34a39cd | ||
|
c1cd3c9830 | ||
|
86efc43d0e | ||
|
cd53239701 |
12
NEWS.md
12
NEWS.md
@ -4,6 +4,18 @@ OpenRC NEWS
|
||||
This file will contain a list of notable changes for each release. Note
|
||||
the information in this file is in reverse order.
|
||||
|
||||
## OpenRC 0.50
|
||||
|
||||
This is a bug fix release which fixes a significant performance issue on
|
||||
musl libc systems.
|
||||
|
||||
## OpenRC 0.49
|
||||
|
||||
This release adds support for glibc's builtin
|
||||
strlcpy, strlcat etc functions, which will be in posix next.
|
||||
Also, it fixes completions.
|
||||
|
||||
|
||||
## OpenRC 0.48
|
||||
|
||||
This release is a maintenance release; it has no user-facing changes.
|
||||
|
@ -92,13 +92,11 @@ _rc_service()
|
||||
return 0
|
||||
elif [[ ${COMP_CWORD} -eq 2 ]] && [[ ${prev} != -* ]]; then # if second word typed and we didn't type in a function
|
||||
rc-service --exists "$prev" || return
|
||||
shopt -s extglob
|
||||
while read -r _ line; do
|
||||
if [[ $line == +([[:alnum:]_]):* ]]; then
|
||||
opts+="${line%%:*} "
|
||||
fi
|
||||
done < <(rc-service "$prev" describe 2>&1)
|
||||
shopt -u extglob
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||
return 0
|
||||
fi
|
||||
|
14
meson.build
14
meson.build
@ -1,5 +1,5 @@
|
||||
project('OpenRC', 'c',
|
||||
version : '0.48',
|
||||
version : '0.50',
|
||||
license: 'BSD-2',
|
||||
default_options : [
|
||||
'c_std=c99',
|
||||
@ -195,12 +195,14 @@ if cc.compiles(malloc_attribute_test, name : 'malloc attribute with arguments')
|
||||
add_project_arguments('-DHAVE_MALLOC_EXTENDED_ATTRIBUTE', language: 'c')
|
||||
endif
|
||||
|
||||
if cc.has_function('closefrom', prefix: '#define _GNU_SOURCE\n#include <unistd.h>')
|
||||
add_project_arguments('-DHAVE_CLOSEFROM', language: 'c')
|
||||
if cc.has_function('close_range', prefix: '#define _GNU_SOURCE\n#include <unistd.h>')
|
||||
add_project_arguments('-DHAVE_CLOSE_RANGE', language: 'c')
|
||||
elif cc.has_header('linux/close_range.h')
|
||||
add_project_arguments('-DHAVE_LINUX_CLOSE_RANGE_H', language: 'c')
|
||||
endif
|
||||
if cc.has_function('close_range', prefix: '#define _GNU_SOURCE\n#include <unistd.h>') and \
|
||||
cc.has_header_symbol('unistd.h', 'CLOSE_RANGE_CLOEXEC', prefix: '#define _GNU_SOURCE')
|
||||
add_project_arguments('-DHAVE_CLOSE_RANGE_CLOEXEC', language: 'c')
|
||||
|
||||
if cc.has_function('strlcpy', prefix: '#define _GNU_SOURCE\n#include <string.h>')
|
||||
add_project_arguments('-DHAVE_STRLCPY', language: 'c')
|
||||
endif
|
||||
|
||||
incdir = include_directories('src/shared')
|
||||
|
@ -146,9 +146,7 @@ static const char *const color_terms[] = {
|
||||
};
|
||||
#endif
|
||||
|
||||
/* strlcat and strlcpy are nice, shame glibc does not define them */
|
||||
#ifdef __GLIBC__
|
||||
# if !defined (__UCLIBC__) && !defined (__dietlibc__)
|
||||
#ifndef HAVE_STRLCPY
|
||||
static size_t
|
||||
strlcat(char *dst, const char *src, size_t size)
|
||||
{
|
||||
@ -176,7 +174,6 @@ strlcat(char *dst, const char *src, size_t size)
|
||||
|
||||
return dst_n + (s - src);
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
static bool
|
||||
|
@ -527,7 +527,7 @@ runlevel_config(const char *service, const char *level)
|
||||
char *conf, *dir;
|
||||
bool retval;
|
||||
|
||||
dir = dirname(init);
|
||||
dir = dirname(dirname(init));
|
||||
xasprintf(&conf, "%s/conf.d/%s.%s", dir, service, level);
|
||||
retval = exists(conf);
|
||||
free(conf);
|
||||
|
@ -37,10 +37,8 @@
|
||||
|
||||
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
|
||||
|
||||
#ifdef __GLIBC__
|
||||
# if !defined (__UCLIBC__) && !defined (__dietlibc__)
|
||||
#ifndef HAVE_STRLCPY
|
||||
# define strlcpy(dst, src, size) snprintf(dst, size, "%s", src)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef timespecsub
|
||||
|
@ -15,10 +15,18 @@
|
||||
* except according to the terms contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CLOSE_RANGE
|
||||
/* For close_range() */
|
||||
# define _GNU_SOURCE
|
||||
#endif
|
||||
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <limits.h>
|
||||
#ifdef HAVE_LINUX_CLOSE_RANGE_H
|
||||
# include <linux/close_range.h>
|
||||
#endif
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@ -26,6 +34,7 @@
|
||||
#include <sys/file.h>
|
||||
#include <sys/time.h>
|
||||
#ifdef __linux__
|
||||
# include <sys/syscall.h> /* for close_range */
|
||||
# include <sys/sysinfo.h>
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
@ -500,3 +509,30 @@ pid_t get_pid(const char *applet,const char *pidfile)
|
||||
|
||||
return pid;
|
||||
}
|
||||
|
||||
#ifndef HAVE_CLOSE_RANGE
|
||||
static inline int close_range(int first RC_UNUSED,
|
||||
int last RC_UNUSED,
|
||||
unsigned int flags RC_UNUSED)
|
||||
{
|
||||
#ifdef SYS_close_range
|
||||
return syscall(SYS_close_range, first, last, flags);
|
||||
#else
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
#ifndef CLOSE_RANGE_CLOEXEC
|
||||
# define CLOSE_RANGE_CLOEXEC (1U << 2)
|
||||
#endif
|
||||
|
||||
void
|
||||
cloexec_fds_from(int first)
|
||||
{
|
||||
int i;
|
||||
if (close_range(first, UINT_MAX, CLOSE_RANGE_CLOEXEC) < 0) {
|
||||
for (i = getdtablesize() - 1; i >= first; --i)
|
||||
fcntl(i, F_SETFD, FD_CLOEXEC);
|
||||
}
|
||||
}
|
||||
|
@ -73,4 +73,6 @@ void from_time_t(char *time_string, time_t tv);
|
||||
time_t to_time_t(char *timestring);
|
||||
pid_t get_pid(const char *applet, const char *pidfile);
|
||||
|
||||
void cloexec_fds_from(int);
|
||||
|
||||
#endif
|
||||
|
@ -1098,12 +1098,7 @@ int main(int argc, char **argv)
|
||||
|| rc_yesno(getenv("EINFO_QUIET")))
|
||||
dup2(stderr_fd, STDERR_FILENO);
|
||||
|
||||
#ifdef HAVE_CLOSEFROM
|
||||
closefrom(3);
|
||||
#else
|
||||
for (i = getdtablesize() - 1; i >= 3; --i)
|
||||
close(i);
|
||||
#endif
|
||||
cloexec_fds_from(3);
|
||||
|
||||
if (scheduler != NULL) {
|
||||
int scheduler_index;
|
||||
|
@ -22,11 +22,6 @@
|
||||
#define ONE_SECOND 1000000000
|
||||
#define ONE_MS 1000000
|
||||
|
||||
#ifdef HAVE_CLOSE_RANGE_CLOEXEC
|
||||
/* For close_range() */
|
||||
# define _GNU_SOURCE
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <getopt.h>
|
||||
@ -570,11 +565,8 @@ RC_NORETURN static void child_process(char *exec, char **argv)
|
||||
if (redirect_stderr || rc_yesno(getenv("EINFO_QUIET")))
|
||||
dup2(stderr_fd, STDERR_FILENO);
|
||||
|
||||
#ifdef HAVE_CLOSE_RANGE_CLOEXEC
|
||||
if (close_range(3, UINT_MAX, CLOSE_RANGE_CLOEXEC) < 0)
|
||||
#endif
|
||||
for (i = getdtablesize() - 1; i >= 3; --i)
|
||||
fcntl(i, F_SETFD, FD_CLOEXEC);
|
||||
cloexec_fds_from(3);
|
||||
|
||||
cmdline = make_cmdline(argv);
|
||||
syslog(LOG_INFO, "Child command line: %s", cmdline);
|
||||
free(cmdline);
|
||||
|
@ -11,7 +11,6 @@ sysvinit="$4"
|
||||
if [ "${os}" != Linux ]; then
|
||||
install -d "${DESTDIR}/${rc_libexecdir}"/init.d
|
||||
fi
|
||||
install -d "${DESTDIR}/${rc_libexecdir}"/tmp
|
||||
install -m 644 "${MESON_BUILD_ROOT}/src/shared/version" "${DESTDIR}/${rc_libexecdir}"
|
||||
if [ "${os}" = Linux ] && [ "${sysvinit}" = yes ]; then
|
||||
ln -s openrc-init "${DESTDIR}/${sbindir}"/init
|
||||
|
Loading…
Reference in New Issue
Block a user