summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-01-14 02:01:42 +0100
committerLennart Poettering <lennart@poettering.net>2015-01-14 23:18:33 +0100
commit679bc6cb9016715339aac4ae6b2d5371c6262935 (patch)
tree22829c825af5988f0c9feaaa41ae3dd491f26004
parent8937422f3b8c4a163ffa4df697ef2939161f4f53 (diff)
ptyfw: add missing error check
-rw-r--r--src/shared/ptyfwd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/shared/ptyfwd.c b/src/shared/ptyfwd.c
index a780f7de9a..31274a1418 100644
--- a/src/shared/ptyfwd.c
+++ b/src/shared/ptyfwd.c
@@ -293,7 +293,7 @@ static int on_sigwinch_event(sd_event_source *e, const struct signalfd_siginfo *
/* The window size changed, let's forward that. */
if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws) >= 0)
- (void)ioctl(f->master, TIOCSWINSZ, &ws);
+ (void) ioctl(f->master, TIOCSWINSZ, &ws);
return 0;
}
@@ -373,6 +373,8 @@ int pty_forward_new(sd_event *event, int master, bool ignore_vhangup, PTYForward
return r;
r = sd_event_add_signal(f->event, &f->sigwinch_event_source, SIGWINCH, on_sigwinch_event, f);
+ if (r < 0)
+ return r;
*ret = f;
f = NULL;