summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Pitt <martinpitt@users.noreply.github.com>2017-04-21 21:36:56 +0200
committerGitHub <noreply@github.com>2017-04-21 21:36:56 +0200
commit56744c037da0ba2032fba0c7ac116317bb5ae4ae (patch)
treedb0347ca9acff034003a7d947fd9e77729affa41 /src
parent301fb51922d435d5f5ef02d234dc7a271ecca930 (diff)
parent62cc1c55cb6909c9b0065bf55940bc5a5780f67b (diff)
Merge pull request #5756 from keszybz/make-cleanups
Various meson-independent cleanups from the meson patchset
Diffstat (limited to 'src')
-rw-r--r--src/basic/def.h4
-rw-r--r--src/basic/missing.h2
-rw-r--r--src/basic/random-util.c8
-rw-r--r--src/journal-remote/journal-remote.c2
-rw-r--r--src/journal-remote/microhttpd-util.h13
-rw-r--r--src/journal/test-compress-benchmark.c7
-rw-r--r--src/journal/test-compress.c6
-rw-r--r--src/libsystemd/sd-bus/test-bus-track.c2
-rw-r--r--src/rc-local-generator/rc-local-generator.c8
-rw-r--r--src/resolve/resolved-dns-server.c2
-rw-r--r--src/resolve/resolved-dns-transaction.c2
-rw-r--r--src/resolve/resolved-dns-trust-anchor.c2
-rw-r--r--src/shared/cgroup-show.c2
-rw-r--r--src/shared/cgroup-show.h2
-rw-r--r--src/shared/dissect-image.c8
-rw-r--r--src/test/test-exec-util.c2
16 files changed, 42 insertions, 30 deletions
diff --git a/src/basic/def.h b/src/basic/def.h
index 200ea973c1..b1a3bc190b 100644
--- a/src/basic/def.h
+++ b/src/basic/def.h
@@ -67,10 +67,6 @@
.un.sun_path = "\0/org/freedesktop/plymouthd", \
}
-#ifndef TTY_GID
-#define TTY_GID 5
-#endif
-
#define NOTIFY_FD_MAX 768
#define NOTIFY_BUFFER_MAX PIPE_BUF
diff --git a/src/basic/missing.h b/src/basic/missing.h
index 284cbaffc0..e860fa7c2c 100644
--- a/src/basic/missing.h
+++ b/src/basic/missing.h
@@ -68,8 +68,6 @@ struct sockaddr_vm {
};
#endif /* !HAVE_LINUX_VM_SOCKETS_H */
-#include "macro.h"
-
#ifndef RLIMIT_RTTIME
#define RLIMIT_RTTIME 15
#endif
diff --git a/src/basic/random-util.c b/src/basic/random-util.c
index ad7b3eedf2..b216be579d 100644
--- a/src/basic/random-util.c
+++ b/src/basic/random-util.c
@@ -27,7 +27,13 @@
#include <stdint.h>
#ifdef HAVE_SYS_AUXV_H
-#include <sys/auxv.h>
+# include <sys/auxv.h>
+#endif
+
+#ifdef USE_SYS_RANDOM_H
+# include <sys/random.h>
+#else
+# include <linux/random.h>
#endif
#include "fd-util.h"
diff --git a/src/journal-remote/journal-remote.c b/src/journal-remote/journal-remote.c
index 2d1a88027a..36c1a32dcd 100644
--- a/src/journal-remote/journal-remote.c
+++ b/src/journal-remote/journal-remote.c
@@ -529,7 +529,7 @@ static int process_http_upload(
log_warning("Failed to process data for connection %p", connection);
if (r == -E2BIG)
return mhd_respondf(connection,
- r, MHD_HTTP_REQUEST_ENTITY_TOO_LARGE,
+ r, MHD_HTTP_PAYLOAD_TOO_LARGE,
"Entry is too large, maximum is " STRINGIFY(DATA_SIZE_MAX) " bytes.");
else
return mhd_respondf(connection,
diff --git a/src/journal-remote/microhttpd-util.h b/src/journal-remote/microhttpd-util.h
index 49def4f630..7f88c2cb7d 100644
--- a/src/journal-remote/microhttpd-util.h
+++ b/src/journal-remote/microhttpd-util.h
@@ -31,14 +31,21 @@
# define MHD_HTTP_NOT_ACCEPTABLE MHD_HTTP_METHOD_NOT_ACCEPTABLE
#endif
+/* Renamed in µhttpd 0.9.51 */
+#ifndef MHD_USE_PIPE_FOR_SHUTDOWN
+# define MHD_USE_ITC MHD_USE_PIPE_FOR_SHUTDOWN
+#endif
+
/* Renamed in µhttpd 0.9.52 */
#ifndef MHD_USE_EPOLL_LINUX_ONLY
# define MHD_USE_EPOLL MHD_USE_EPOLL_LINUX_ONLY
#endif
-/* Renamed in µhttpd 0.9.51 */
-#ifndef MHD_USE_PIPE_FOR_SHUTDOWN
-# define MHD_USE_ITC MHD_USE_PIPE_FOR_SHUTDOWN
+/* Both the old and new names are defines, check for the new one. */
+
+/* Renamed in µhttpd 0.9.53 */
+#ifndef MHD_HTTP_PAYLOAD_TOO_LARGE
+# define MHD_HTTP_PAYLOAD_TOO_LARGE MHD_HTTP_REQUEST_ENTITY_TOO_LARGE
#endif
#if MHD_VERSION < 0x00094203
diff --git a/src/journal/test-compress-benchmark.c b/src/journal/test-compress-benchmark.c
index 6f6d71435d..4fb93ded73 100644
--- a/src/journal/test-compress-benchmark.c
+++ b/src/journal/test-compress-benchmark.c
@@ -30,6 +30,8 @@ typedef int (compress_t)(const void *src, uint64_t src_size, void *dst,
typedef int (decompress_t)(const void *src, uint64_t src_size,
void **dst, size_t *dst_alloc_size, size_t* dst_size, size_t dst_max);
+#if defined(HAVE_XZ) || defined(HAVE_LZ4)
+
static usec_t arg_duration = 2 * USEC_PER_SEC;
static size_t arg_start;
@@ -151,8 +153,10 @@ static void test_compress_decompress(const char* label, const char* type,
100 - compressed * 100. / total,
skipped);
}
+#endif
int main(int argc, char *argv[]) {
+#if defined(HAVE_XZ) || defined(HAVE_LZ4)
const char *i;
log_set_max_level(LOG_INFO);
@@ -177,4 +181,7 @@ int main(int argc, char *argv[]) {
#endif
}
return 0;
+#else
+ return EXIT_TEST_SKIP;
+#endif
}
diff --git a/src/journal/test-compress.c b/src/journal/test-compress.c
index 44a2cf5217..92108a84b3 100644
--- a/src/journal/test-compress.c
+++ b/src/journal/test-compress.c
@@ -54,6 +54,7 @@ typedef int (decompress_sw_t)(const void *src, uint64_t src_size,
typedef int (compress_stream_t)(int fdf, int fdt, uint64_t max_bytes);
typedef int (decompress_stream_t)(int fdf, int fdt, uint64_t max_size);
+#if defined(HAVE_XZ) || defined(HAVE_LZ4)
static void test_compress_decompress(int compression,
compress_blob_t compress,
decompress_blob_t decompress,
@@ -203,6 +204,7 @@ static void test_compress_stream(int compression,
assert_se(unlink(pattern) == 0);
assert_se(unlink(pattern2) == 0);
}
+#endif
#ifdef HAVE_LZ4
static void test_lz4_decompress_partial(void) {
@@ -247,6 +249,7 @@ static void test_lz4_decompress_partial(void) {
#endif
int main(int argc, char *argv[]) {
+#if defined(HAVE_XZ) || defined(HAVE_LZ4)
const char text[] =
"text\0foofoofoofoo AAAA aaaaaaaaa ghost busters barbarbar FFF"
"foofoofoofoo AAAA aaaaaaaaa ghost busters barbarbar FFF";
@@ -312,4 +315,7 @@ int main(int argc, char *argv[]) {
#endif
return 0;
+#else
+ return EXIT_TEST_SKIP;
+#endif
}
diff --git a/src/libsystemd/sd-bus/test-bus-track.c b/src/libsystemd/sd-bus/test-bus-track.c
index 4beb61f05a..06c6167511 100644
--- a/src/libsystemd/sd-bus/test-bus-track.c
+++ b/src/libsystemd/sd-bus/test-bus-track.c
@@ -17,7 +17,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sd-bus.h>
+#include "sd-bus.h"
#include "macro.h"
diff --git a/src/rc-local-generator/rc-local-generator.c b/src/rc-local-generator/rc-local-generator.c
index b704ca3b4b..db3bf5bd21 100644
--- a/src/rc-local-generator/rc-local-generator.c
+++ b/src/rc-local-generator/rc-local-generator.c
@@ -28,14 +28,6 @@
#include "string-util.h"
#include "util.h"
-#ifndef RC_LOCAL_SCRIPT_PATH_START
-#define RC_LOCAL_SCRIPT_PATH_START "/etc/rc.d/rc.local"
-#endif
-
-#ifndef RC_LOCAL_SCRIPT_PATH_STOP
-#define RC_LOCAL_SCRIPT_PATH_STOP "/sbin/halt.local"
-#endif
-
static const char *arg_dest = "/tmp";
static int add_symlink(const char *service, const char *where) {
diff --git a/src/resolve/resolved-dns-server.c b/src/resolve/resolved-dns-server.c
index 5498f7b9cb..63cb6a5bda 100644
--- a/src/resolve/resolved-dns-server.c
+++ b/src/resolve/resolved-dns-server.c
@@ -17,7 +17,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sd-messages.h>
+#include "sd-messages.h"
#include "alloc-util.h"
#include "resolved-dns-server.h"
diff --git a/src/resolve/resolved-dns-transaction.c b/src/resolve/resolved-dns-transaction.c
index ff2ad9c1de..3075f62b5e 100644
--- a/src/resolve/resolved-dns-transaction.c
+++ b/src/resolve/resolved-dns-transaction.c
@@ -17,7 +17,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sd-messages.h>
+#include "sd-messages.h"
#include "af-list.h"
#include "alloc-util.h"
diff --git a/src/resolve/resolved-dns-trust-anchor.c b/src/resolve/resolved-dns-trust-anchor.c
index 7e9f9e5a20..dda9875063 100644
--- a/src/resolve/resolved-dns-trust-anchor.c
+++ b/src/resolve/resolved-dns-trust-anchor.c
@@ -17,7 +17,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sd-messages.h>
+#include "sd-messages.h"
#include "alloc-util.h"
#include "conf-files.h"
diff --git a/src/shared/cgroup-show.c b/src/shared/cgroup-show.c
index 8765cf2f49..436130edea 100644
--- a/src/shared/cgroup-show.c
+++ b/src/shared/cgroup-show.c
@@ -24,8 +24,6 @@
#include <stdlib.h>
#include <string.h>
-#include <systemd/sd-bus.h>
-
#include "alloc-util.h"
#include "bus-error.h"
#include "bus-util.h"
diff --git a/src/shared/cgroup-show.h b/src/shared/cgroup-show.h
index 736f0f34c8..1764f76744 100644
--- a/src/shared/cgroup-show.h
+++ b/src/shared/cgroup-show.h
@@ -22,7 +22,7 @@
#include <stdbool.h>
#include <sys/types.h>
-#include <systemd/sd-bus.h>
+#include "sd-bus.h"
#include "logs-show.h"
#include "output-mode.h"
diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c
index 36c94ac71b..163995c1e5 100644
--- a/src/shared/dissect-image.c
+++ b/src/shared/dissect-image.c
@@ -42,8 +42,8 @@
#include "udev-util.h"
#include "xattr-util.h"
+_unused_ static int probe_filesystem(const char *node, char **ret_fstype) {
#ifdef HAVE_BLKID
-static int probe_filesystem(const char *node, char **ret_fstype) {
_cleanup_blkid_free_probe_ blkid_probe b = NULL;
const char *fstype;
int r;
@@ -80,8 +80,10 @@ static int probe_filesystem(const char *node, char **ret_fstype) {
not_found:
*ret_fstype = NULL;
return 0;
-}
+#else
+ return -EOPNOTSUPP;
#endif
+}
int dissect_image(int fd, const void *root_hash, size_t root_hash_size, DissectImageFlags flags, DissectedImage **ret) {
@@ -949,7 +951,7 @@ int dissected_image_decrypt(
*
* = 0 → There was nothing to decrypt
* > 0 → Decrypted successfully
- * -ENOKEY → There's some to decrypt but no key was supplied
+ * -ENOKEY → There's something to decrypt but no key was supplied
* -EKEYREJECTED → Passed key was not correct
*/
diff --git a/src/test/test-exec-util.c b/src/test/test-exec-util.c
index 482b0751b9..30c92019d9 100644
--- a/src/test/test-exec-util.c
+++ b/src/test/test-exec-util.c
@@ -223,7 +223,7 @@ static int gather_stdout_three(int fd, void *arg) {
return 0;
}
-const gather_stdout_callback_t const gather_stdout[] = {
+const gather_stdout_callback_t gather_stdout[] = {
gather_stdout_one,
gather_stdout_two,
gather_stdout_three,