summaryrefslogtreecommitdiff
path: root/src/core/job.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-02-01 11:34:56 +0100
committerLennart Poettering <lennart@poettering.net>2016-02-01 11:34:56 +0100
commitda21f8743ae66ddec9dc596f0c182747f8b00daa (patch)
tree94489a3f9b2983e6be9780651109043eac0b203a /src/core/job.c
parenta6c5361bb1fff4c38459bb4a352d8a4b5a1e6a0c (diff)
parentf596e00f32766df011b322b1b0c700add0aae032 (diff)
Merge pull request #2493 from evverx/fix-selinux-checks
Fix selinux check for ReloadUnit
Diffstat (limited to 'src/core/job.c')
-rw-r--r--src/core/job.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/core/job.c b/src/core/job.c
index 4e111ffb46..d8fdf1b53f 100644
--- a/src/core/job.c
+++ b/src/core/job.c
@@ -1240,3 +1240,15 @@ static const char* const job_result_table[_JOB_RESULT_MAX] = {
};
DEFINE_STRING_TABLE_LOOKUP(job_result, JobResult);
+
+const char* job_type_to_access_method(JobType t) {
+ assert(t >= 0);
+ assert(t < _JOB_TYPE_MAX);
+
+ if (IN_SET(t, JOB_START, JOB_RESTART, JOB_TRY_RESTART))
+ return "start";
+ else if (t == JOB_STOP)
+ return "stop";
+ else
+ return "reload";
+}