chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rename basic.la to shared.la and put selinux deps in shared-selinx.la
[elogind.git]
/
src
/
install.c
diff --git
a/src/install.c
b/src/install.c
index 7443973502e6177ad0794304be3bfe716d7eb5b1..45018043c27a4cbf09b4d640aad2a12703e24a1a 100644
(file)
--- a/
src/install.c
+++ b/
src/install.c
@@
-26,6
+26,7
@@
#include <fnmatch.h>
#include "util.h"
#include <fnmatch.h>
#include "util.h"
+#include "mkdir.h"
#include "hashmap.h"
#include "set.h"
#include "path-lookup.h"
#include "hashmap.h"
#include "set.h"
#include "path-lookup.h"
@@
-72,9
+73,8
@@
static int get_config_path(UnitFileScope scope, bool runtime, const char *root_d
case UNIT_FILE_SYSTEM:
if (root_dir && runtime)
case UNIT_FILE_SYSTEM:
if (root_dir && runtime)
- return -EINVAL;
-
- if (runtime)
+ asprintf(&p, "%s/run/systemd/system", root_dir);
+ else if (runtime)
p = strdup("/run/systemd/system");
else if (root_dir)
asprintf(&p, "%s/%s", root_dir, SYSTEM_CONFIG_UNIT_PATH);
p = strdup("/run/systemd/system");
else if (root_dir)
asprintf(&p, "%s/%s", root_dir, SYSTEM_CONFIG_UNIT_PATH);
@@
-479,7
+479,6
@@
static int find_symlinks_fd(
t = path_make_absolute(name, config_path);
if (!t) {
free(p);
t = path_make_absolute(name, config_path);
if (!t) {
free(p);
- free(dest);
r = -ENOMEM;
break;
}
r = -ENOMEM;
break;
}
@@
-1573,10
+1572,10
@@
UnitFileState unit_file_get_state(
}
if (lstat(path, &st) < 0) {
}
if (lstat(path, &st) < 0) {
+ r = -errno;
if (errno == ENOENT)
continue;
if (errno == ENOENT)
continue;
- r = -errno;
goto finish;
}
goto finish;
}
@@
-1855,7
+1854,7
@@
int unit_file_get_list(
r = dirent_ensure_type(d, de);
if (r < 0) {
r = dirent_ensure_type(d, de);
if (r < 0) {
- if (
errno ==
ENOENT)
+ if (
r == -
ENOENT)
continue;
goto finish;
continue;
goto finish;
@@
-1905,7
+1904,7
@@
int unit_file_get_list(
} else if (r > 0) {
f->state = UNIT_FILE_DISABLED;
goto found;
} else if (r > 0) {
f->state = UNIT_FILE_DISABLED;
goto found;
- } else
if (r == 0)
{
+ } else {
f->state = UNIT_FILE_STATIC;
goto found;
}
f->state = UNIT_FILE_STATIC;
goto found;
}