chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ARM: detect-virt: detect QEMU/KVM
[elogind.git]
/
src
/
shared
/
condition.c
diff --git
a/src/shared/condition.c
b/src/shared/condition.c
index dcbf9a7e86a52f2ef089339550b6da4f02eba41f..db12df952b143aa8bf4e36528fd9763e5e1c7c8d 100644
(file)
--- a/
src/shared/condition.c
+++ b/
src/shared/condition.c
@@
-23,15
+23,12
@@
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
-#include <sys/statvfs.h>
#include <fnmatch.h>
#include "sd-id128.h"
#include "util.h"
#include "virt.h"
#include "path-util.h"
#include <fnmatch.h>
#include "sd-id128.h"
#include "util.h"
#include "virt.h"
#include "path-util.h"
-#include "fileio.h"
-#include "unit.h"
#include "architecture.h"
#include "smack-util.h"
#include "apparmor-util.h"
#include "architecture.h"
#include "smack-util.h"
#include "apparmor-util.h"
@@
-47,7
+44,7
@@
Condition* condition_new(ConditionType type, const char *parameter, bool trigger
assert(type >= 0);
assert(type < _CONDITION_TYPE_MAX);
assert(type >= 0);
assert(type < _CONDITION_TYPE_MAX);
- assert(
!parameter
== (type == CONDITION_NULL));
+ assert(
(!parameter)
== (type == CONDITION_NULL));
c = new0(Condition, 1);
if (!c)
c = new0(Condition, 1);
if (!c)
@@
-73,11
+70,13
@@
void condition_free(Condition *c) {
free(c);
}
free(c);
}
-
void
condition_free_list(Condition *first) {
+
Condition*
condition_free_list(Condition *first) {
Condition *c, *n;
LIST_FOREACH_SAFE(conditions, c, n, first)
condition_free(c);
Condition *c, *n;
LIST_FOREACH_SAFE(conditions, c, n, first)
condition_free(c);
+
+ return NULL;
}
static int condition_test_kernel_command_line(Condition *c) {
}
static int condition_test_kernel_command_line(Condition *c) {
@@
-101,7
+100,7
@@
static int condition_test_kernel_command_line(Condition *c) {
_cleanup_free_ char *word = NULL;
bool found;
_cleanup_free_ char *word = NULL;
bool found;
- r = unquote_first_word(&p, &word,
true
);
+ r = unquote_first_word(&p, &word,
UNQUOTE_RELAX
);
if (r < 0)
return r;
if (r == 0)
if (r < 0)
return r;
if (r == 0)
@@
-287,7
+286,7
@@
static int condition_test_needs_update(Condition *c) {
if (!path_is_absolute(c->parameter))
return true;
if (!path_is_absolute(c->parameter))
return true;
- p = str
append
a(c->parameter, "/.updated");
+ p = str
join
a(c->parameter, "/.updated");
if (lstat(p, &other) < 0)
return true;
if (lstat(p, &other) < 0)
return true;