Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
sulincix authored Sep 5, 2023
2 parents 5d2cd25 + b2c4eb9 commit a9a07c1
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ 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.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.
Expand Down
6 changes: 5 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
project('OpenRC', 'c',
version : '0.48',
version : '0.49',
license: 'BSD-2',
default_options : [
'c_std=c99',
Expand Down Expand Up @@ -203,6 +203,10 @@ if cc.has_function('close_range', prefix: '#define _GNU_SOURCE\n#include <unistd
add_project_arguments('-DHAVE_CLOSE_RANGE_CLOEXEC', language: 'c')
endif

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')
einfo_incdir = include_directories('src/libeinfo')
rc_incdir = include_directories('src/librc')
Expand Down
5 changes: 1 addition & 4 deletions src/libeinfo/libeinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -176,7 +174,6 @@ strlcat(char *dst, const char *src, size_t size)

return dst_n + (s - src);
}
# endif
#endif

static bool
Expand Down
4 changes: 1 addition & 3 deletions src/shared/helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion tools/meson_final.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a9a07c1

Please sign in to comment.