summaryrefslogtreecommitdiffstats
path: root/src/journal-remote/journal-gatewayd.c
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2022-08-09 14:35:15 +0200
committerDavid Tardon <dtardon@redhat.com>2022-09-13 08:13:27 +0200
commit995340074e554b4bf4a0fdb0cb7436692c5a4ffd (patch)
treeca3ee001db3e608ee80478f42fea9c3b409f1b7b /src/journal-remote/journal-gatewayd.c
parentMerge pull request #23087 from yuwata/udev-watch (diff)
downloadsystemd-995340074e554b4bf4a0fdb0cb7436692c5a4ffd.tar.xz
systemd-995340074e554b4bf4a0fdb0cb7436692c5a4ffd.zip
tree-wide: use ASSERT_PTR more
Diffstat (limited to 'src/journal-remote/journal-gatewayd.c')
-rw-r--r--src/journal-remote/journal-gatewayd.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/journal-remote/journal-gatewayd.c b/src/journal-remote/journal-gatewayd.c
index 8fb07bc02f..cdfeb1fc80 100644
--- a/src/journal-remote/journal-gatewayd.c
+++ b/src/journal-remote/journal-gatewayd.c
@@ -147,11 +147,10 @@ static ssize_t request_reader_entries(
char *buf,
size_t max) {
- RequestMeta *m = cls;
+ RequestMeta *m = ASSERT_PTR(cls);
int r;
size_t n, k;
- assert(m);
assert(buf);
assert(max > 0);
assert(pos >= m->delta);
@@ -359,12 +358,10 @@ static mhd_result request_parse_arguments_iterator(
const char *key,
const char *value) {
- RequestMeta *m = cls;
+ RequestMeta *m = ASSERT_PTR(cls);
_cleanup_free_ char *p = NULL;
int r;
- assert(m);
-
if (isempty(key)) {
m->argument_parse_error = -EINVAL;
return MHD_NO;
@@ -467,11 +464,10 @@ static int request_handler_entries(
void *connection_cls) {
_cleanup_(MHD_destroy_responsep) struct MHD_Response *response = NULL;
- RequestMeta *m = connection_cls;
+ RequestMeta *m = ASSERT_PTR(connection_cls);
int r;
assert(connection);
- assert(m);
r = open_journal(m);
if (r < 0)
@@ -541,11 +537,10 @@ static ssize_t request_reader_fields(
char *buf,
size_t max) {
- RequestMeta *m = cls;
+ RequestMeta *m = ASSERT_PTR(cls);
int r;
size_t n, k;
- assert(m);
assert(buf);
assert(max > 0);
assert(pos >= m->delta);
@@ -616,11 +611,10 @@ static int request_handler_fields(
void *connection_cls) {
_cleanup_(MHD_destroy_responsep) struct MHD_Response *response = NULL;
- RequestMeta *m = connection_cls;
+ RequestMeta *m = ASSERT_PTR(connection_cls);
int r;
assert(connection);
- assert(m);
r = open_journal(m);
if (r < 0)
@@ -734,7 +728,7 @@ static int request_handler_machine(
void *connection_cls) {
_cleanup_(MHD_destroy_responsep) struct MHD_Response *response = NULL;
- RequestMeta *m = connection_cls;
+ RequestMeta *m = ASSERT_PTR(connection_cls);
int r;
_cleanup_free_ char* hostname = NULL, *os_name = NULL;
uint64_t cutoff_from = 0, cutoff_to = 0, usage = 0;
@@ -742,7 +736,6 @@ static int request_handler_machine(
_cleanup_free_ char *v = NULL, *json = NULL;
assert(connection);
- assert(m);
r = open_journal(m);
if (r < 0)