summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>2013-12-10 22:30:46 +0100
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>2013-12-10 22:30:46 +0100
commit96115cdfe0241ae9b4e7177cd3874c0a93d00b39 (patch)
tree0d5c641ceb00c3b1535dc2b1de328f36d97c4060 /src
parentff4994c50717be97ad4df3dc77fce5125f881c7c (diff)
fix scan-build issues
The static analyzer scan-build had a few issues with analysing parts of systemd. gpt-auto-generator.c: scan-build could not find blkid.h. Whether it should be blkid.h or blkid/blkid.h seems to depend on the version used. We already use blkid/blkid.h in udev-builtin-blkid.c so it seems safe to use that here too. Makefile.am: Moved some -D's from CFLAGS to CPPFLAGS. I also simplified them a bit and got rid of a left over DBUS_CFLAGS. test-cgroup-mask.c/test-sched-prio.c A variable was added to store the replaced TEST_DIR. When wrapped in an assert_se TEST_DIR was not replaced in the logged error. While not an issue introduced in this patch we might as well fix it up while we are here.
Diffstat (limited to 'src')
-rw-r--r--src/gpt-auto-generator/gpt-auto-generator.c2
-rw-r--r--src/test/test-cgroup-mask.c3
-rw-r--r--src/test/test-sched-prio.c3
3 files changed, 5 insertions, 3 deletions
diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c
index 3cbafa4d51..017c35dcd6 100644
--- a/src/gpt-auto-generator/gpt-auto-generator.c
+++ b/src/gpt-auto-generator/gpt-auto-generator.c
@@ -24,7 +24,7 @@
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/statfs.h>
-#include <blkid.h>
+#include <blkid/blkid.h>
#ifdef HAVE_LINUX_BTRFS_H
#include <linux/btrfs.h>
diff --git a/src/test/test-cgroup-mask.c b/src/test/test-cgroup-mask.c
index 0f145d6bc4..99c8ceea76 100644
--- a/src/test/test-cgroup-mask.c
+++ b/src/test/test-cgroup-mask.c
@@ -37,9 +37,10 @@ static int test_cgroup_mask(void) {
FILE *serial = NULL;
FDSet *fdset = NULL;
int r;
+ const char *dir = TEST_DIR;
/* Prepare the manager. */
- assert_se(set_unit_path(TEST_DIR) >= 0);
+ assert_se(set_unit_path(dir) >= 0);
r = manager_new(SYSTEMD_USER, &m);
if (r == -EPERM || r == -EACCES) {
puts("manager_new: Permission denied. Skipping test.");
diff --git a/src/test/test-sched-prio.c b/src/test/test-sched-prio.c
index 56e11f8daf..a4cc3d44a2 100644
--- a/src/test/test-sched-prio.c
+++ b/src/test/test-sched-prio.c
@@ -31,9 +31,10 @@ int main(int argc, char *argv[]) {
FILE *serial = NULL;
FDSet *fdset = NULL;
int r;
+ const char *dir = TEST_DIR;
/* prepare the test */
- assert_se(set_unit_path(TEST_DIR) >= 0);
+ assert_se(set_unit_path(dir) >= 0);
r = manager_new(SYSTEMD_USER, &m);
if (r == -EPERM || r == -EACCES || r == -EADDRINUSE || r == -EHOSTDOWN) {
printf("Skipping test: manager_new: %s", strerror(-r));