143bfdaf0b890fa7acadf02d1eafacaef1b696bdHolger Hans Peter Freyther#pragma once
143bfdaf0b890fa7acadf02d1eafacaef1b696bdHolger Hans Peter Freyther
143bfdaf0b890fa7acadf02d1eafacaef1b696bdHolger Hans Peter Freyther/***
143bfdaf0b890fa7acadf02d1eafacaef1b696bdHolger Hans Peter Freyther This file is part of systemd.
143bfdaf0b890fa7acadf02d1eafacaef1b696bdHolger Hans Peter Freyther
143bfdaf0b890fa7acadf02d1eafacaef1b696bdHolger Hans Peter Freyther Copyright 2013 Holger Hans Peter Freyther
143bfdaf0b890fa7acadf02d1eafacaef1b696bdHolger Hans Peter Freyther
143bfdaf0b890fa7acadf02d1eafacaef1b696bdHolger Hans Peter Freyther systemd is free software; you can redistribute it and/or modify it
143bfdaf0b890fa7acadf02d1eafacaef1b696bdHolger Hans Peter Freyther under the terms of the GNU Lesser General Public License as published by
143bfdaf0b890fa7acadf02d1eafacaef1b696bdHolger Hans Peter Freyther the Free Software Foundation; either version 2.1 of the License, or
143bfdaf0b890fa7acadf02d1eafacaef1b696bdHolger Hans Peter Freyther (at your option) any later version.
143bfdaf0b890fa7acadf02d1eafacaef1b696bdHolger Hans Peter Freyther
143bfdaf0b890fa7acadf02d1eafacaef1b696bdHolger Hans Peter Freyther systemd is distributed in the hope that it will be useful, but
143bfdaf0b890fa7acadf02d1eafacaef1b696bdHolger Hans Peter Freyther WITHOUT ANY WARRANTY; without even the implied warranty of
143bfdaf0b890fa7acadf02d1eafacaef1b696bdHolger Hans Peter Freyther MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
143bfdaf0b890fa7acadf02d1eafacaef1b696bdHolger Hans Peter Freyther Lesser General Public License for more details.
143bfdaf0b890fa7acadf02d1eafacaef1b696bdHolger Hans Peter Freyther
143bfdaf0b890fa7acadf02d1eafacaef1b696bdHolger Hans Peter Freyther You should have received a copy of the GNU Lesser General Public License
143bfdaf0b890fa7acadf02d1eafacaef1b696bdHolger Hans Peter Freyther along with systemd; If not, see <http://www.gnu.org/licenses/>.
143bfdaf0b890fa7acadf02d1eafacaef1b696bdHolger Hans Peter Freyther***/
143bfdaf0b890fa7acadf02d1eafacaef1b696bdHolger Hans Peter Freyther
143bfdaf0b890fa7acadf02d1eafacaef1b696bdHolger Hans Peter Freyther#include "sd-daemon.h"
143bfdaf0b890fa7acadf02d1eafacaef1b696bdHolger Hans Peter Freyther
8b3aa503c171acdb9ec63484a8c50e2680d31e79Zbigniew Jędrzejewski-Szmek#include "macro.h"
8b3aa503c171acdb9ec63484a8c50e2680d31e79Zbigniew Jędrzejewski-Szmek
143bfdaf0b890fa7acadf02d1eafacaef1b696bdHolger Hans Peter Freyther#define TEST_REQ_RUNNING_SYSTEMD(x) \
90e633a7901060063e62bf53948c4c239a9f55d1Jason St. John if (sd_booted() > 0) { \
90e633a7901060063e62bf53948c4c239a9f55d1Jason St. John x; \
143bfdaf0b890fa7acadf02d1eafacaef1b696bdHolger Hans Peter Freyther } else { \
143bfdaf0b890fa7acadf02d1eafacaef1b696bdHolger Hans Peter Freyther printf("systemd not booted skipping '%s'\n", #x); \
143bfdaf0b890fa7acadf02d1eafacaef1b696bdHolger Hans Peter Freyther }
8b3aa503c171acdb9ec63484a8c50e2680d31e79Zbigniew Jędrzejewski-Szmek
8b3aa503c171acdb9ec63484a8c50e2680d31e79Zbigniew Jędrzejewski-Szmek#define MANAGER_SKIP_TEST(r) \
8b3aa503c171acdb9ec63484a8c50e2680d31e79Zbigniew Jędrzejewski-Szmek IN_SET(r, \
8b3aa503c171acdb9ec63484a8c50e2680d31e79Zbigniew Jędrzejewski-Szmek -EPERM, \
8b3aa503c171acdb9ec63484a8c50e2680d31e79Zbigniew Jędrzejewski-Szmek -EACCES, \
8b3aa503c171acdb9ec63484a8c50e2680d31e79Zbigniew Jędrzejewski-Szmek -EADDRINUSE, \
8b3aa503c171acdb9ec63484a8c50e2680d31e79Zbigniew Jędrzejewski-Szmek -EHOSTDOWN, \
8b3aa503c171acdb9ec63484a8c50e2680d31e79Zbigniew Jędrzejewski-Szmek -ENOENT, \
8b3aa503c171acdb9ec63484a8c50e2680d31e79Zbigniew Jędrzejewski-Szmek -ENOMEDIUM /* cannot determine cgroup */ \
8b3aa503c171acdb9ec63484a8c50e2680d31e79Zbigniew Jędrzejewski-Szmek )