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.
test_cgroup_mask_SOURCES = \
src/test/test-cgroup-mask.c
test_cgroup_mask_SOURCES = \
src/test/test-cgroup-mask.c
-test_cgroup_mask_CFLAGS = \
- $(AM_CFLAGS) \
- $(DBUS_CFLAGS) \
- -D"STR(s)=\#s" -D"TEST_DIR=STR($(abs_top_srcdir)/test/)"
+test_cgroup_mask_CPPFLAGS = \
+ $(AM_CPPFLAGS) \
+ -DTEST_DIR=\"$(abs_top_srcdir)/test\"
test_cgroup_mask_LDADD = \
libsystemd-core.la \
test_cgroup_mask_LDADD = \
libsystemd-core.la \
test_sched_prio_SOURCES = \
src/test/test-sched-prio.c
test_sched_prio_SOURCES = \
src/test/test-sched-prio.c
-test_sched_prio_CFLAGS = \
- $(AM_CFLAGS) \
- -D"STR(s)=\#s" -D"TEST_DIR=STR($(abs_top_srcdir)/test/)"
+test_sched_prio_CPPFLAGS = \
+ $(AM_CPPFLAGS) \
+ -DTEST_DIR=\"$(abs_top_srcdir)/test\"
test_sched_prio_LDADD = \
libsystemd-core.la \
test_sched_prio_LDADD = \
libsystemd-core.la \
test_catalog_SOURCES = \
src/journal/test-catalog.c
test_catalog_SOURCES = \
src/journal/test-catalog.c
-test_catalog_CFLAGS = \
- $(AM_CFLAGS) \
+test_catalog_CPPFLAGS = \
+ $(AM_CPPFLAGS) \
-DCATALOG_DIR=\"$(abs_top_srcdir)/catalog\"
test_catalog_LDADD = \
-DCATALOG_DIR=\"$(abs_top_srcdir)/catalog\"
test_catalog_LDADD = \
systemd_journal_gatewayd_CFLAGS = \
$(AM_CFLAGS) \
systemd_journal_gatewayd_CFLAGS = \
$(AM_CFLAGS) \
- -DDOCUMENT_ROOT=\"$(gatewayddocumentrootdir)\" \
+systemd_journal_gatewayd_CPPFLAGS = \
+ $(AM_CPPFLAGS) \
+ -DDOCUMENT_ROOT=\"$(gatewayddocumentrootdir)\"
+
dist_systemunit_DATA += \
units/systemd-journal-gatewayd.socket
dist_systemunit_DATA += \
units/systemd-journal-gatewayd.socket
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/statfs.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/statfs.h>
+#include <blkid/blkid.h>
#ifdef HAVE_LINUX_BTRFS_H
#include <linux/btrfs.h>
#ifdef HAVE_LINUX_BTRFS_H
#include <linux/btrfs.h>
FILE *serial = NULL;
FDSet *fdset = NULL;
int r;
FILE *serial = NULL;
FDSet *fdset = NULL;
int r;
+ const char *dir = TEST_DIR;
/* Prepare the manager. */
/* 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.");
r = manager_new(SYSTEMD_USER, &m);
if (r == -EPERM || r == -EACCES) {
puts("manager_new: Permission denied. Skipping test.");
FILE *serial = NULL;
FDSet *fdset = NULL;
int r;
FILE *serial = NULL;
FDSet *fdset = NULL;
int r;
+ const char *dir = TEST_DIR;
- 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));
r = manager_new(SYSTEMD_USER, &m);
if (r == -EPERM || r == -EACCES || r == -EADDRINUSE || r == -EHOSTDOWN) {
printf("Skipping test: manager_new: %s", strerror(-r));