From f39d4a08e746e703d562076a0f622eb91dbdcd3e Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 6 Mar 2014 16:35:02 +0100 Subject: systemctl: for switch-root check, if we switch to a systemd init If "systemctl switch-root" is called with a specific "INIT" or /proc/cmdline contains "init=", then systemd would not serialize itsself. Let systemctl check, if the new init is in the standard systemd installation path and if so, clear the INIT parameter, to let systemd serialize itsself. --- src/shared/util.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/shared/util.h') diff --git a/src/shared/util.h b/src/shared/util.h index 11d28665b6..cc52ae7503 100644 --- a/src/shared/util.h +++ b/src/shared/util.h @@ -813,6 +813,19 @@ int unlink_noerrno(const char *path); _c_; \ }) +#define strappenda3(a, b, c) \ + ({ \ + const char *_a_ = (a), *_b_ = (b), *_c_ = (c); \ + char *_d_; \ + size_t _x_, _y_, _z_; \ + _x_ = strlen(_a_); \ + _y_ = strlen(_b_); \ + _z_ = strlen(_c_); \ + _d_ = alloca(_x_ + _y_ + _z_ + 1); \ + strcpy(stpcpy(stpcpy(_d_, _a_), _b_), _c_); \ + _d_; \ + }) + #define procfs_file_alloca(pid, field) \ ({ \ pid_t _pid_ = (pid); \ -- cgit v1.2.3-54-g00ecf