summaryrefslogtreecommitdiff
path: root/src/manager.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-03-09 22:45:47 +0100
committerLennart Poettering <lennart@poettering.net>2011-03-09 22:45:47 +0100
commitb925e72633bf98438f56a140520e07ec8c959e46 (patch)
tree7daba41fbb22be20a8a094fa792407a036b26ff1 /src/manager.c
parent29d958ce2ba49794fa92dd77b2f9a9bdc941f493 (diff)
dev: use /dev/.run/systemd as runtime directory, instead of /dev/.systemd
Diffstat (limited to 'src/manager.c')
-rw-r--r--src/manager.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/manager.c b/src/manager.c
index 194ad66a02..8bbde7c38e 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -2550,22 +2550,20 @@ void manager_dispatch_bus_query_pid_done(
}
int manager_open_serialization(Manager *m, FILE **_f) {
- char *path;
+ char *path = NULL;
mode_t saved_umask;
int fd;
FILE *f;
assert(_f);
- if (m->running_as == MANAGER_SYSTEM) {
- mkdir_p("/dev/.systemd", 0755);
+ if (m->running_as == MANAGER_SYSTEM)
+ asprintf(&path, "/dev/.run/systemd/dump-%lu-XXXXXX", (unsigned long) getpid());
+ else
+ asprintf(&path, "/tmp/systemd-dump-%lu-XXXXXX", (unsigned long) getpid());
- if (asprintf(&path, "/dev/.systemd/dump-%lu-XXXXXX", (unsigned long) getpid()) < 0)
- return -ENOMEM;
- } else {
- if (asprintf(&path, "/tmp/systemd-dump-%lu-XXXXXX", (unsigned long) getpid()) < 0)
- return -ENOMEM;
- }
+ if (!path)
+ return -ENOMEM;
saved_umask = umask(0077);
fd = mkostemp(path, O_RDWR|O_CLOEXEC);
@@ -2862,7 +2860,7 @@ void manager_run_generators(Manager *m) {
if (!m->generator_unit_path) {
char *p;
- char system_path[] = "/dev/.systemd/generator-XXXXXX",
+ char system_path[] = "/dev/.run/systemd/generator-XXXXXX",
user_path[] = "/tmp/systemd-generator-XXXXXX";
if (!(p = mkdtemp(m->running_as == MANAGER_SYSTEM ? system_path : user_path))) {