Merge pull request #31411 from poettering/build-path

userdbd,homed,importd,sysupdate,pid1: make it easier to run daemons that have callouts from build dir
This commit is contained in:
Luca Boccassi
2024-02-23 11:57:42 +00:00
committed by GitHub
13 changed files with 355 additions and 115 deletions
+1
View File
@@ -51,6 +51,7 @@ simple_tests += files(
'test-bitmap.c',
'test-blockdev-util.c',
'test-bootspec.c',
'test-build-path.c',
'test-bus-util.c',
'test-calendarspec.c',
'test-cgroup-setup.c',
+20
View File
@@ -0,0 +1,20 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "build-path.h"
#include "log.h"
#include "string-util.h"
int main(int argc, char* argv[]) {
_cleanup_free_ char *p = NULL;
int r;
r = get_build_exec_dir(&p);
if (r == -ENOEXEC)
log_info("Not run from build dir.");
else if (r < 0)
log_error_errno(r, "Failed to find build dir: %m");
else
log_info("%s", strna(p));
return 0;
}