From: Sven Eden Date: Wed, 4 Jan 2017 05:40:46 +0000 (+0100) Subject: Prep v225: Applying various fixes and changes to src/shared that got lost during... X-Git-Tag: v226.4~1^2~114 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=ba812e282b3406f478e8ede2b6eb885f61fae6fc;ds=sidebyside Prep v225: Applying various fixes and changes to src/shared that got lost during git am transfer. --- diff --git a/src/shared/cgroup-show.h b/src/shared/cgroup-show.h index 7c9c3f652..e32e92e40 100644 --- a/src/shared/cgroup-show.h +++ b/src/shared/cgroup-show.h @@ -24,7 +24,6 @@ #include #include // #include "logs-show.h" -#include "output-mode.h" int show_cgroup_by_path(const char *path, const char *prefix, unsigned columns, bool kernel_threads, OutputFlags flags); int show_cgroup(const char *controller, const char *path, const char *prefix, unsigned columns, bool kernel_threads, OutputFlags flags); diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c index b01aadcd7..8e4aa957b 100644 --- a/src/shared/conf-parser.c +++ b/src/shared/conf-parser.c @@ -333,8 +333,7 @@ int config_parse(const char *unit, return -ENOMEM; } - free(continuation); - continuation = NULL; + continuation = mfree(continuation); p = c; } else p = l; diff --git a/src/shared/path-lookup.h b/src/shared/path-lookup.h index 3982974ba..e35c8d3c0 100644 --- a/src/shared/path-lookup.h +++ b/src/shared/path-lookup.h @@ -23,32 +23,39 @@ #include "macro.h" -typedef enum UnitFileScope UnitFileScope; - typedef struct LookupPaths { char **unit_path; +#ifdef HAVE_SYSV_COMPAT + char **sysvinit_path; + char **sysvrcnd_path; +#endif } LookupPaths; -typedef enum SystemdRunningAs { - SYSTEMD_SYSTEM, - SYSTEMD_USER, - _SYSTEMD_RUNNING_AS_MAX, - _SYSTEMD_RUNNING_AS_INVALID = -1 -} SystemdRunningAs; +typedef enum ManagerRunningAs { + MANAGER_SYSTEM, + MANAGER_USER, + _MANAGER_RUNNING_AS_MAX, + _MANAGER_RUNNING_AS_INVALID = -1 +} ManagerRunningAs; int user_config_home(char **config_home); int user_runtime_dir(char **runtime_dir); +char **generator_paths(ManagerRunningAs running_as); + int lookup_paths_init(LookupPaths *p, - SystemdRunningAs running_as, + ManagerRunningAs running_as, bool personal, const char *root_dir, const char *generator, const char *generator_early, const char *generator_late); -void lookup_paths_free(LookupPaths *p); + +#include "install.h" + int lookup_paths_init_from_scope(LookupPaths *paths, UnitFileScope scope, const char *root_dir); +void lookup_paths_free(LookupPaths *p); #define _cleanup_lookup_paths_free_ _cleanup_(lookup_paths_free) diff --git a/src/shared/udev-util.h b/src/shared/udev-util.h index a729bceaa..f758ce13e 100644 --- a/src/shared/udev-util.h +++ b/src/shared/udev-util.h @@ -21,16 +21,26 @@ along with systemd; If not, see . ***/ -#include "libudev.h" +#include "udev.h" #include "util.h" DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev*, udev_unref); DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_device*, udev_device_unref); DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_enumerate*, udev_enumerate_unref); +DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_event*, udev_event_unref); +DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_rules*, udev_rules_unref); +DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_ctrl*, udev_ctrl_unref); +DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_ctrl_connection*, udev_ctrl_connection_unref); +DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_ctrl_msg*, udev_ctrl_msg_unref); DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_monitor*, udev_monitor_unref); #define _cleanup_udev_unref_ _cleanup_(udev_unrefp) #define _cleanup_udev_device_unref_ _cleanup_(udev_device_unrefp) #define _cleanup_udev_enumerate_unref_ _cleanup_(udev_enumerate_unrefp) +#define _cleanup_udev_event_unref_ _cleanup_(udev_event_unrefp) +#define _cleanup_udev_rules_unref_ _cleanup_(udev_rules_unrefp) +#define _cleanup_udev_ctrl_unref_ _cleanup_(udev_ctrl_unrefp) +#define _cleanup_udev_ctrl_connection_unref_ _cleanup_(udev_ctrl_connection_unrefp) +#define _cleanup_udev_ctrl_msg_unref_ _cleanup_(udev_ctrl_msg_unrefp) #define _cleanup_udev_monitor_unref_ _cleanup_(udev_monitor_unrefp) #define _cleanup_udev_list_cleanup_ _cleanup_(udev_list_cleanup)