chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
share/log: skip file/line/func info if empty
[elogind.git]
/
src
/
shared
/
path-lookup.c
diff --git
a/src/shared/path-lookup.c
b/src/shared/path-lookup.c
index a9c3e21d5120836ea8d02a64ab42d3c19b70ade7..6e5529e0c729861db3aa6974ba28a629e1062796 100644
(file)
--- a/
src/shared/path-lookup.c
+++ b/
src/shared/path-lookup.c
@@
-22,6
+22,7
@@
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
+#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <unistd.h>
#include <errno.h>
@@
-31,6
+32,13
@@
#include "path-util.h"
#include "path-lookup.h"
#include "path-util.h"
#include "path-lookup.h"
+static const char* const systemd_running_as_table[_SYSTEMD_RUNNING_AS_MAX] = {
+ [SYSTEMD_SYSTEM] = "system",
+ [SYSTEMD_USER] = "user"
+};
+
+DEFINE_STRING_TABLE_LOOKUP(systemd_running_as, SystemdRunningAs);
+
int user_config_home(char **config_home) {
const char *e;
int user_config_home(char **config_home) {
const char *e;
@@
-224,7
+232,7
@@
fail:
int lookup_paths_init(
LookupPaths *p,
int lookup_paths_init(
LookupPaths *p,
-
Manager
RunningAs running_as,
+
Systemd
RunningAs running_as,
bool personal,
const char *generator,
const char *generator_early,
bool personal,
const char *generator,
const char *generator_early,
@@
-256,7
+264,7
@@
int lookup_paths_init(
* for the system stuff but avoid it for user
* stuff. */
* for the system stuff but avoid it for user
* stuff. */
- if (running_as ==
MANAGER
_USER) {
+ if (running_as ==
SYSTEMD
_USER) {
if (personal)
p->unit_path = user_dirs(generator, generator_early, generator_late);
if (personal)
p->unit_path = user_dirs(generator, generator_early, generator_late);
@@
-323,7
+331,7
@@
int lookup_paths_init(
p->unit_path = NULL;
}
p->unit_path = NULL;
}
- if (running_as ==
MANAGER
_SYSTEM) {
+ if (running_as ==
SYSTEMD
_SYSTEM) {
#ifdef HAVE_SYSV_COMPAT
/* /etc/init.d/ compatibility does not matter to users */
#ifdef HAVE_SYSV_COMPAT
/* /etc/init.d/ compatibility does not matter to users */