[systemd-commits] 2 commits - Makefile.am src/shared src/systemctl
Zbigniew Jędrzejewski-Szmek
zbyszek at kemper.freedesktop.org
Mon Jan 5 08:13:44 PST 2015
Makefile.am | 1 +
src/shared/install.c | 16 ----------------
src/shared/path-lookup.c | 16 ++++++++++++++++
src/shared/path-lookup.h | 4 ++++
src/systemctl/systemctl.c | 6 +-----
5 files changed, 22 insertions(+), 21 deletions(-)
New commits:
commit 60d27f1916c90871c063819a6e7d586c7a663789
Author: Ivan Shapovalov <intelfx100 at gmail.com>
Date: Fri Dec 19 17:08:07 2014 +0300
path-lookup, systemctl: export lookup_paths_init_from_scope() from shared/install.c and use it
diff --git a/src/shared/install.c b/src/shared/install.c
index 3b06544..37191a7 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -58,22 +58,6 @@ static int in_search_path(const char *path, char **search) {
return strv_contains(search, parent);
}
-static int lookup_paths_init_from_scope(LookupPaths *paths,
- UnitFileScope scope,
- const char *root_dir) {
- assert(paths);
- assert(scope >= 0);
- assert(scope < _UNIT_FILE_SCOPE_MAX);
-
- zero(*paths);
-
- return lookup_paths_init(paths,
- scope == UNIT_FILE_SYSTEM ? SYSTEMD_SYSTEM : SYSTEMD_USER,
- scope == UNIT_FILE_USER,
- root_dir,
- NULL, NULL, NULL);
-}
-
static int get_config_path(UnitFileScope scope, bool runtime, const char *root_dir, char **ret) {
char *p = NULL;
int r;
diff --git a/src/shared/path-lookup.c b/src/shared/path-lookup.c
index 8f75a8e..051f1a4 100644
--- a/src/shared/path-lookup.c
+++ b/src/shared/path-lookup.c
@@ -398,3 +398,19 @@ void lookup_paths_free(LookupPaths *p) {
p->sysvinit_path = p->sysvrcnd_path = NULL;
#endif
}
+
+int lookup_paths_init_from_scope(LookupPaths *paths,
+ UnitFileScope scope,
+ const char *root_dir) {
+ assert(paths);
+ assert(scope >= 0);
+ assert(scope < _UNIT_FILE_SCOPE_MAX);
+
+ zero(*paths);
+
+ return lookup_paths_init(paths,
+ scope == UNIT_FILE_SYSTEM ? SYSTEMD_SYSTEM : SYSTEMD_USER,
+ scope == UNIT_FILE_USER,
+ root_dir,
+ NULL, NULL, NULL);
+}
diff --git a/src/shared/path-lookup.h b/src/shared/path-lookup.h
index b8a0aac..655e454 100644
--- a/src/shared/path-lookup.h
+++ b/src/shared/path-lookup.h
@@ -22,6 +22,7 @@
***/
#include "macro.h"
+#include "install.h"
typedef struct LookupPaths {
char **unit_path;
@@ -49,5 +50,8 @@ int lookup_paths_init(LookupPaths *p,
const char *generator_early,
const char *generator_late);
void lookup_paths_free(LookupPaths *p);
+int lookup_paths_init_from_scope(LookupPaths *paths,
+ UnitFileScope scope,
+ const char *root_dir);
#define _cleanup_lookup_paths_free_ _cleanup_(lookup_paths_free)
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 3d939f0..6795414 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -4515,11 +4515,7 @@ static int init_home_and_lookup_paths(char **user_home, char **user_runtime, Loo
return log_error_errno(ENOTDIR, "Cannot find units: $XDG_RUNTIME_DIR is not set.");
}
- r = lookup_paths_init(lp,
- arg_scope == UNIT_FILE_SYSTEM ? SYSTEMD_SYSTEM : SYSTEMD_USER,
- arg_scope == UNIT_FILE_USER,
- arg_root,
- NULL, NULL, NULL);
+ r = lookup_paths_init_from_scope(lp, arg_scope, arg_root);
if (r < 0)
return log_error_errno(r, "Failed to lookup unit lookup paths: %m");
commit 69c4e2771ec58d111191afe397a402e488e223ba
Author: Filipe Brandenburger <filbranden at google.com>
Date: Mon Dec 29 15:22:33 2014 -0800
machine: add reference to machine-dbus.h to Makefile.am
Commit 003dffde2c1b93 ("machined: Move image discovery logic into src/shared,
so that we can make use of it from nspawn") moved some definitions from
machine.h to a new machine-dbus.h, but did not include it in Makefile.am
Tested that `make distcheck` works after this fix.
diff --git a/Makefile.am b/Makefile.am
index 0b46a12..21097bf 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5053,6 +5053,7 @@ libsystemd_machine_core_la_SOURCES = \
src/machine/machine.h \
src/machine/machined-dbus.c \
src/machine/machine-dbus.c \
+ src/machine/machine-dbus.h \
src/machine/image-dbus.c \
src/machine/image-dbus.h
More information about the systemd-commits
mailing list