elogind: update to 241.1.

This commit is contained in:
maxice8 2019-03-13 19:51:09 -03:00 committed by maxice8
parent 1d24ebe252
commit fa92192b9d
7 changed files with 156 additions and 4 deletions

View File

@ -0,0 +1,13 @@
diff --git src/shared/musl_missing.h src/shared/musl_missing.h
index 6f1e25b..eaa7ca7 100644
--- src/shared/musl_missing.h
+++ src/shared/musl_missing.h
@@ -81,6 +81,7 @@ void elogind_set_program_name(const char* pcall);
# define __COMPAR_FN_T
typedef int (*__compar_fn_t) (const void *, const void *);
typedef __compar_fn_t comparison_fn_t;
+typedef int (*__compar_d_fn_t) (const void *, const void *, void *);
#endif
/* Make musl utmp/wtmp stubs visible if needed. */

View File

@ -0,0 +1,14 @@
diff --git src/basic/util.h src/basic/util.h
index 64e709f..426a25c 100644
--- src/basic/util.h
+++ src/basic/util.h
@@ -27,6 +27,9 @@
#include "macro.h"
#include "time-util.h"
+/* Needed by musl for __compar_fn_t */
+#include "musl_missing.h"
+
size_t page_size(void) _pure_;
#define PAGE_ALIGN(l) ALIGN_TO((l), page_size())

View File

@ -0,0 +1,26 @@
diff --git src/basic/parse-printf-format.c src/basic/parse-printf-format.c
index a99952b..a241760 100644
--- src/basic/parse-printf-format.c
+++ src/basic/parse-printf-format.c
@@ -25,7 +25,7 @@
#include "parse-printf-format.h"
-#ifndef HAVE_PRINTF_H
+#if HAVE_PRINTF_H == 0
static const char *consume_nonarg(const char *fmt)
{
diff --git src/basic/parse-printf-format.h src/basic/parse-printf-format.h
index 5ca0fdf..b36b0fa 100644
--- src/basic/parse-printf-format.h
+++ src/basic/parse-printf-format.h
@@ -24,7 +24,7 @@
#include "config.h"
-#ifdef HAVE_PRINTF_H
+#if HAVE_PRINTF_H == 1
#include <printf.h>
#else

View File

@ -0,0 +1,50 @@
diff --git src/basic/format-util.h src/basic/format-util.h
index dece5d3..dbb87bc 100644
--- src/basic/format-util.h
+++ src/basic/format-util.h
@@ -42,13 +42,7 @@
# define PRI_TIMEX "li"
#endif
-#if SIZEOF_RLIM_T == 8
-# define RLIM_FMT "%" PRIu64
-#elif SIZEOF_RLIM_T == 4
-# define RLIM_FMT "%" PRIu32
-#else
-# error Unknown rlim_t size
-#endif
+#define RLIM_FMT "%ju"
#if SIZEOF_DEV_T == 8
# define DEV_FMT "%" PRIu64
diff --git src/basic/rlimit-util.c src/basic/rlimit-util.c
index 38e8873..0f7adb5 100644
--- src/basic/rlimit-util.c
+++ src/basic/rlimit-util.c
@@ -308,13 +308,13 @@ int rlimit_format(const struct rlimit *rl, char **ret) {
if (rl->rlim_cur >= RLIM_INFINITY && rl->rlim_max >= RLIM_INFINITY)
s = strdup("infinity");
else if (rl->rlim_cur >= RLIM_INFINITY)
- (void) asprintf(&s, "infinity:" RLIM_FMT, rl->rlim_max);
+ (void) asprintf(&s, "infinity:" RLIM_FMT, (uintmax_t)rl->rlim_max);
else if (rl->rlim_max >= RLIM_INFINITY)
- (void) asprintf(&s, RLIM_FMT ":infinity", rl->rlim_cur);
+ (void) asprintf(&s, RLIM_FMT ":infinity", (uintmax_t)rl->rlim_cur);
else if (rl->rlim_cur == rl->rlim_max)
- (void) asprintf(&s, RLIM_FMT, rl->rlim_cur);
+ (void) asprintf(&s, RLIM_FMT, (uintmax_t)rl->rlim_cur);
else
- (void) asprintf(&s, RLIM_FMT ":" RLIM_FMT, rl->rlim_cur, rl->rlim_max);
+ (void) asprintf(&s, RLIM_FMT ":" RLIM_FMT, (uintmax_t)rl->rlim_cur, (uintmax_t)rl->rlim_max);
if (!s)
return -ENOMEM;
@@ -406,7 +406,7 @@ int rlimit_nofile_safe(void) {
rl.rlim_cur = FD_SETSIZE;
if (setrlimit(RLIMIT_NOFILE, &rl) < 0)
- return log_debug_errno(errno, "Failed to lower RLIMIT_NOFILE's soft limit to " RLIM_FMT ": %m", rl.rlim_cur);
+ return log_debug_errno(errno, "Failed to lower RLIMIT_NOFILE's soft limit to " RLIM_FMT ": %m", (uintmax_t)rl.rlim_cur);
return 1;
}

View File

@ -0,0 +1,15 @@
diff --git src/shared/musl_missing.h src/shared/musl_missing.h
index eaa7ca7..17e946f 100644
--- src/shared/musl_missing.h
+++ src/shared/musl_missing.h
@@ -44,9 +44,6 @@ void elogind_set_program_name(const char* pcall);
# define HAVE_SECURE_GETENV 1
#endif // HAVE_[__]SECURE_GETENV
-/* Poor man's basename */
-#define basename(path) \
- (strrchr(path, '/') ? strrchr(path, '/')+1 : path)
/* strndupa may already be defined in another compatibility header */
#if !defined(strndupa)

View File

@ -0,0 +1,34 @@
From 902412c271e0c5d9cb93b10ec0fb5b119b393474 Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Mon, 25 Feb 2019 16:53:06 +0800
Subject: [PATCH 24/24] test-json.c: define M_PIl
Fix the following compile failure:
src/test/test-json.c:305:50: error: 'M_PIl' undeclared (first use in this function); did you mean 'M_PI'?
Upstream-Status: Inappropriate [musl specific]
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
src/test/test-json.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/test/test-json.c b/src/test/test-json.c
index fdf1b4f..fa541f8 100644
--- src/test/test-json.c
+++ src/test/test-json.c
@@ -10,6 +10,10 @@
#include "strv.h"
#include "util.h"
+#ifndef M_PIl
+#define M_PIl 3.141592653589793238462643383279502884L
+#endif
+
static void test_tokenizer(const char *data, ...) {
unsigned line = 0, column = 0;
void *state = NULL;
--
2.7.4

View File

@ -1,14 +1,14 @@
# Template file for 'elogind'
pkgname=elogind
version=239.4
version=241.1
revision=1
build_style=meson
configure_args="-Dcgroup-controller=elogind -Dhalt-path=/usr/bin/halt
-Drootlibexecdir=/usr/libexec/elogind -Dreboot-path=/usr/bin/reboot
-Dkexec-path=/usr/bin/kexec -Ddefault-hierarchy=legacy"
hostmakedepends="docbook-xsl gettext-devel git gperf intltool libxslt m4
pkg-config shadow"
makedepends="acl-devel eudev-libudev-devel gettext-devel glib-devel libcap-devel
pkg-config shadow glib-devel"
makedepends="acl-devel eudev-libudev-devel gettext-devel libglib-devel libcap-devel
libseccomp-devel pam-devel"
depends="dbus"
short_desc="Standalone logind fork"
@ -16,7 +16,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
license="GPL-2.0-or-later, LGPL-2.0-or-later"
homepage="https://github.com/elogind/elogind"
distfiles="https://github.com/${pkgname}/${pkgname}/archive/v${version}.tar.gz"
checksum=676194b40fdbdb4f94b96ce22c423e95d1412f518488fc27f8258386277b3b47
checksum=ded3d19dc4b91564b920bae472656a8664f86868fa3edb0554e856e6a8377712
conf_files="/etc/elogind/logind.conf"
pre_check() {