summaryrefslogtreecommitdiffstats
path: root/src/shared/ptyfwd.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/shared/ptyfwd.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/shared/ptyfwd.c')
-rw-r--r--src/shared/ptyfwd.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/shared/ptyfwd.c b/src/shared/ptyfwd.c
index 4c309f925f..6ffe86ef7f 100644
--- a/src/shared/ptyfwd.c
+++ b/src/shared/ptyfwd.c
@@ -338,9 +338,8 @@ static int shovel(PTYForward *f) {
}
static int on_master_event(sd_event_source *e, int fd, uint32_t revents, void *userdata) {
- PTYForward *f = userdata;
+ PTYForward *f = ASSERT_PTR(userdata);
- assert(f);
assert(e);
assert(e == f->master_event_source);
assert(fd >= 0);
@@ -356,9 +355,8 @@ static int on_master_event(sd_event_source *e, int fd, uint32_t revents, void *u
}
static int on_stdin_event(sd_event_source *e, int fd, uint32_t revents, void *userdata) {
- PTYForward *f = userdata;
+ PTYForward *f = ASSERT_PTR(userdata);
- assert(f);
assert(e);
assert(e == f->stdin_event_source);
assert(fd >= 0);
@@ -371,9 +369,8 @@ static int on_stdin_event(sd_event_source *e, int fd, uint32_t revents, void *us
}
static int on_stdout_event(sd_event_source *e, int fd, uint32_t revents, void *userdata) {
- PTYForward *f = userdata;
+ PTYForward *f = ASSERT_PTR(userdata);
- assert(f);
assert(e);
assert(e == f->stdout_event_source);
assert(fd >= 0);
@@ -386,10 +383,9 @@ static int on_stdout_event(sd_event_source *e, int fd, uint32_t revents, void *u
}
static int on_sigwinch_event(sd_event_source *e, const struct signalfd_siginfo *si, void *userdata) {
- PTYForward *f = userdata;
+ PTYForward *f = ASSERT_PTR(userdata);
struct winsize ws;
- assert(f);
assert(e);
assert(e == f->sigwinch_event_source);