From 3d9c3b7e89fd7b48cdabe76ef8aa5d54143e7575 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Sun, 16 Apr 2023 20:21:37 +0200 Subject: [PATCH 1/2] test: modernize test-async a bit Mainly to give it some debug output to, hopefully, see why it sometimes gets stuck in CI when run with sanitizers. --- src/test/test-async.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/test/test-async.c b/src/test/test-async.c index b97fedcfc6..69785e47fa 100644 --- a/src/test/test-async.c +++ b/src/test/test-async.c @@ -4,8 +4,9 @@ #include #include "async.h" -#include "macro.h" +#include "fs-util.h" #include "tmpfile-util.h" +#include "tests.h" static bool test_async = false; @@ -15,24 +16,22 @@ static void *async_func(void *arg) { return NULL; } -int main(int argc, char *argv[]) { +TEST(test_async) { + _cleanup_(unlink_tempfilep) char name[] = "/tmp/test-asynchronous_close.XXXXXX"; int fd; - char name[] = "/tmp/test-asynchronous_close.XXXXXX"; fd = mkostemp_safe(name); assert_se(fd >= 0); asynchronous_close(fd); assert_se(asynchronous_job(async_func, NULL) >= 0); - assert_se(asynchronous_sync(NULL) >= 0); sleep(1); assert_se(fcntl(fd, F_GETFD) == -1); + assert_se(errno == EBADF); assert_se(test_async); - - (void) unlink(name); - - return 0; } + +DEFINE_TEST_MAIN(LOG_DEBUG); From e24c6676c741468fd10b448f3f2c4d133b7dcfe7 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Sun, 16 Apr 2023 20:29:41 +0200 Subject: [PATCH 2/2] docs: add a missing $ sign Addresses https://github.com/systemd/systemd/pull/27283#pullrequestreview-1386816102. Follow-up to 1a127aa02b. --- docs/ENVIRONMENT.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ENVIRONMENT.md b/docs/ENVIRONMENT.md index 791ba8dd12..2ba222d3a6 100644 --- a/docs/ENVIRONMENT.md +++ b/docs/ENVIRONMENT.md @@ -341,7 +341,7 @@ the journal instead of only when logging in debug mode. `systemd-sysusers` -* `SOURCE_DATE_EPOCH` — if unset, the field of the date of last password change +* `$SOURCE_DATE_EPOCH` — if unset, the field of the date of last password change in `/etc/shadow` will be the number of days from Jan 1, 1970 00:00 UTC until today. If `$SOURCE_DATE_EPOCH` is set to a valid UNIX epoch value in seconds, then the field will be the number of days until that time instead. This is to