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
|
This file will contain a list of notable changes for each release. Note
|
||||||
the information in this file is in reverse order.
|
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
|
## OpenRC 0.48
|
||||||
|
|
||||||
This release is a maintenance release; it has no user-facing changes.
|
This release is a maintenance release; it has no user-facing changes.
|
||||||
|
@ -92,13 +92,11 @@ _rc_service()
|
|||||||
return 0
|
return 0
|
||||||
elif [[ ${COMP_CWORD} -eq 2 ]] && [[ ${prev} != -* ]]; then # if second word typed and we didn't type in a function
|
elif [[ ${COMP_CWORD} -eq 2 ]] && [[ ${prev} != -* ]]; then # if second word typed and we didn't type in a function
|
||||||
rc-service --exists "$prev" || return
|
rc-service --exists "$prev" || return
|
||||||
shopt -s extglob
|
|
||||||
while read -r _ line; do
|
while read -r _ line; do
|
||||||
if [[ $line == +([[:alnum:]_]):* ]]; then
|
if [[ $line == +([[:alnum:]_]):* ]]; then
|
||||||
opts+="${line%%:*} "
|
opts+="${line%%:*} "
|
||||||
fi
|
fi
|
||||||
done < <(rc-service "$prev" describe 2>&1)
|
done < <(rc-service "$prev" describe 2>&1)
|
||||||
shopt -u extglob
|
|
||||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
14
meson.build
14
meson.build
@ -1,5 +1,5 @@
|
|||||||
project('OpenRC', 'c',
|
project('OpenRC', 'c',
|
||||||
version : '0.48',
|
version : '0.50',
|
||||||
license: 'BSD-2',
|
license: 'BSD-2',
|
||||||
default_options : [
|
default_options : [
|
||||||
'c_std=c99',
|
'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')
|
add_project_arguments('-DHAVE_MALLOC_EXTENDED_ATTRIBUTE', language: 'c')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if cc.has_function('closefrom', prefix: '#define _GNU_SOURCE\n#include <unistd.h>')
|
if cc.has_function('close_range', prefix: '#define _GNU_SOURCE\n#include <unistd.h>')
|
||||||
add_project_arguments('-DHAVE_CLOSEFROM', language: 'c')
|
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
|
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')
|
if cc.has_function('strlcpy', prefix: '#define _GNU_SOURCE\n#include <string.h>')
|
||||||
add_project_arguments('-DHAVE_CLOSE_RANGE_CLOEXEC', language: 'c')
|
add_project_arguments('-DHAVE_STRLCPY', language: 'c')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
incdir = include_directories('src/shared')
|
incdir = include_directories('src/shared')
|
||||||
|
@ -146,9 +146,7 @@ static const char *const color_terms[] = {
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* strlcat and strlcpy are nice, shame glibc does not define them */
|
#ifndef HAVE_STRLCPY
|
||||||
#ifdef __GLIBC__
|
|
||||||
# if !defined (__UCLIBC__) && !defined (__dietlibc__)
|
|
||||||
static size_t
|
static size_t
|
||||||
strlcat(char *dst, const char *src, size_t size)
|
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);
|
return dst_n + (s - src);
|
||||||
}
|
}
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
|
@ -527,7 +527,7 @@ runlevel_config(const char *service, const char *level)
|
|||||||
char *conf, *dir;
|
char *conf, *dir;
|
||||||
bool retval;
|
bool retval;
|
||||||
|
|
||||||
dir = dirname(init);
|
dir = dirname(dirname(init));
|
||||||
xasprintf(&conf, "%s/conf.d/%s.%s", dir, service, level);
|
xasprintf(&conf, "%s/conf.d/%s.%s", dir, service, level);
|
||||||
retval = exists(conf);
|
retval = exists(conf);
|
||||||
free(conf);
|
free(conf);
|
||||||
|
@ -37,10 +37,8 @@
|
|||||||
|
|
||||||
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
|
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
|
||||||
|
|
||||||
#ifdef __GLIBC__
|
#ifndef HAVE_STRLCPY
|
||||||
# if !defined (__UCLIBC__) && !defined (__dietlibc__)
|
|
||||||
# define strlcpy(dst, src, size) snprintf(dst, size, "%s", src)
|
# define strlcpy(dst, src, size) snprintf(dst, size, "%s", src)
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef timespecsub
|
#ifndef timespecsub
|
||||||
|
@ -15,10 +15,18 @@
|
|||||||
* except according to the terms contained in the LICENSE file.
|
* 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 <ctype.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
#ifdef HAVE_LINUX_CLOSE_RANGE_H
|
||||||
|
# include <linux/close_range.h>
|
||||||
|
#endif
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -26,6 +34,7 @@
|
|||||||
#include <sys/file.h>
|
#include <sys/file.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
|
# include <sys/syscall.h> /* for close_range */
|
||||||
# include <sys/sysinfo.h>
|
# include <sys/sysinfo.h>
|
||||||
#endif
|
#endif
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@ -500,3 +509,30 @@ pid_t get_pid(const char *applet,const char *pidfile)
|
|||||||
|
|
||||||
return pid;
|
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);
|
time_t to_time_t(char *timestring);
|
||||||
pid_t get_pid(const char *applet, const char *pidfile);
|
pid_t get_pid(const char *applet, const char *pidfile);
|
||||||
|
|
||||||
|
void cloexec_fds_from(int);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1098,12 +1098,7 @@ int main(int argc, char **argv)
|
|||||||
|| rc_yesno(getenv("EINFO_QUIET")))
|
|| rc_yesno(getenv("EINFO_QUIET")))
|
||||||
dup2(stderr_fd, STDERR_FILENO);
|
dup2(stderr_fd, STDERR_FILENO);
|
||||||
|
|
||||||
#ifdef HAVE_CLOSEFROM
|
cloexec_fds_from(3);
|
||||||
closefrom(3);
|
|
||||||
#else
|
|
||||||
for (i = getdtablesize() - 1; i >= 3; --i)
|
|
||||||
close(i);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (scheduler != NULL) {
|
if (scheduler != NULL) {
|
||||||
int scheduler_index;
|
int scheduler_index;
|
||||||
|
@ -22,11 +22,6 @@
|
|||||||
#define ONE_SECOND 1000000000
|
#define ONE_SECOND 1000000000
|
||||||
#define ONE_MS 1000000
|
#define ONE_MS 1000000
|
||||||
|
|
||||||
#ifdef HAVE_CLOSE_RANGE_CLOEXEC
|
|
||||||
/* For close_range() */
|
|
||||||
# define _GNU_SOURCE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <getopt.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")))
|
if (redirect_stderr || rc_yesno(getenv("EINFO_QUIET")))
|
||||||
dup2(stderr_fd, STDERR_FILENO);
|
dup2(stderr_fd, STDERR_FILENO);
|
||||||
|
|
||||||
#ifdef HAVE_CLOSE_RANGE_CLOEXEC
|
cloexec_fds_from(3);
|
||||||
if (close_range(3, UINT_MAX, CLOSE_RANGE_CLOEXEC) < 0)
|
|
||||||
#endif
|
|
||||||
for (i = getdtablesize() - 1; i >= 3; --i)
|
|
||||||
fcntl(i, F_SETFD, FD_CLOEXEC);
|
|
||||||
cmdline = make_cmdline(argv);
|
cmdline = make_cmdline(argv);
|
||||||
syslog(LOG_INFO, "Child command line: %s", cmdline);
|
syslog(LOG_INFO, "Child command line: %s", cmdline);
|
||||||
free(cmdline);
|
free(cmdline);
|
||||||
|
@ -11,7 +11,6 @@ sysvinit="$4"
|
|||||||
if [ "${os}" != Linux ]; then
|
if [ "${os}" != Linux ]; then
|
||||||
install -d "${DESTDIR}/${rc_libexecdir}"/init.d
|
install -d "${DESTDIR}/${rc_libexecdir}"/init.d
|
||||||
fi
|
fi
|
||||||
install -d "${DESTDIR}/${rc_libexecdir}"/tmp
|
|
||||||
install -m 644 "${MESON_BUILD_ROOT}/src/shared/version" "${DESTDIR}/${rc_libexecdir}"
|
install -m 644 "${MESON_BUILD_ROOT}/src/shared/version" "${DESTDIR}/${rc_libexecdir}"
|
||||||
if [ "${os}" = Linux ] && [ "${sysvinit}" = yes ]; then
|
if [ "${os}" = Linux ] && [ "${sysvinit}" = yes ]; then
|
||||||
ln -s openrc-init "${DESTDIR}/${sbindir}"/init
|
ln -s openrc-init "${DESTDIR}/${sbindir}"/init
|
||||||
|
Loading…
Reference in New Issue
Block a user