Files
horizon-packages/srcpkgs/elogind/patches/tests2.patch
T
589788a74f elogind: update to 255.22.
Co-authored-by: Daniel Martinez <danielpedromartinez@duck.com>
Co-authored-by: oreo639 <oreo6391@gmail.com>
2026-01-08 17:38:09 -08:00

90 lines
2.8 KiB
Diff

Partially taken from: https://github.com/chimera-linux/cports/blob/1c65848071683787eac91da86823339c4e85d208/main/elogind/patches/xxx-musl-fixes.patch
FTW_CONTINUE does not exist on musl
Read-only permission in fdopen() doesn't get applied in musl
EINVAL is returned by parse_sec(" .22s ", &u)
Fix test-login without active logind session due to using if instead of else if.
diff --git a/src/test/test-recurse-dir.c b/src/test/test-recurse-dir.c
index f607048..d6f1b29 100644
--- a/src/test/test-recurse-dir.c
+++ b/src/test/test-recurse-dir.c
@@ -1,5 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#if 0
#include <ftw.h>
#include "fd-util.h"
@@ -116,8 +117,10 @@ static int recurse_dir_callback(
return RECURSE_DIR_CONTINUE;
}
+#endif
int main(int argc, char *argv[]) {
+#if 0
_cleanup_strv_free_ char **list_recurse_dir = NULL;
const char *p;
usec_t t1, t2, t3, t4;
@@ -173,5 +176,6 @@ int main(int argc, char *argv[]) {
}
list_nftw = strv_free(list_nftw);
+#endif
return 0;
}
diff --git a/src/test/test-fileio.c b/src/test/test-fileio.c
index b9b82e7..5a43685 100644
--- a/src/test/test-fileio.c
+++ b/src/test/test-fileio.c
@@ -427,6 +428,7 @@ TEST(read_one_line_file) {
assert_se(streq_ptr(buf5, "x"));
}
+#if 0
TEST(write_string_stream) {
_cleanup_(unlink_tempfilep) char fn[] = "/tmp/test-write_string_stream-XXXXXX";
_cleanup_fclose_ FILE *f = NULL;
@@ -461,6 +463,7 @@ TEST(write_string_stream) {
printf(">%s<", buf);
assert_se(streq(buf, "boohoo"));
}
+#endif
TEST(write_string_file) {
_cleanup_(unlink_tempfilep) char fn[] = "/tmp/test-write_string_file-XXXXXX";
diff --git a/src/test/test-time-util.c b/src/test/test-time-util.c
index 1ce6710..8d247a7 100644
--- a/src/test/test-time-util.c
+++ b/src/test/test-time-util.c
@@ -12,6 +12,7 @@
#define TRIAL 100u
+#if 0
TEST(parse_sec) {
usec_t u;
@@ -1181,6 +1162,7 @@ TEST(timezone_offset_change) {
tzset();
}
#endif // 0
+#endif
static int intro(void) {
/* Tests have hard-coded results that do not expect a specific timezone to be set by the caller */
diff -rup test-login.c.orig test-login.c
--- a/src/libelogind/sd-login/test-login.c
+++ b/src/libelogind/sd-login/test-login.c
@@ -149,7 +149,7 @@ TEST(login) {
log_notice("sd_session_is_active() failed with ENXIO, it seems logind is not running.");
#if 1 /// If elogind is tested on a system run by systemd, we will get -EINVAL,
// because elogind does not support systemd scopes, services and slices.
- if (r == -EINVAL)
+ else if (r == -EINVAL)
log_notice("sd_session_is_active() failed with EINVAL, elogind can not handle systemd powered systems.");
#endif // 1
else {