X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Fpty.c;h=a87b3ce6f0ba4efa6ca09b3ef26cdd7834b25c12;hb=d896ac2d2fbce41a0b11a0618a685adeaf18b8fe;hp=6863be654eaa676a4f82cc12af45b6f2ebb2cecd;hpb=611b312b7d0799281347374dc303c73a066cedf8;p=elogind.git diff --git a/src/shared/pty.c b/src/shared/pty.c index 6863be654..a87b3ce6f 100644 --- a/src/shared/pty.c +++ b/src/shared/pty.c @@ -44,18 +44,12 @@ #include #include -#include -#include #include #include #include -#include #include -#include #include -#include #include -#include #include #include #include @@ -63,9 +57,10 @@ #include "barrier.h" #include "macro.h" -#include "pty.h" #include "ring.h" #include "util.h" +#include "signal-util.h" +#include "pty.h" #define PTY_BUFSIZE 4096 @@ -244,7 +239,7 @@ int pty_setup_child(Pty *pty) { assert_return(pty_is_child(pty), -EINVAL); assert_return(pty_is_open(pty), -EALREADY); - r = sigprocmask_many(SIG_SETMASK, -1); + r = reset_signal_mask(); if (r < 0) return r; @@ -550,16 +545,15 @@ int pty_signal(Pty *pty, int sig) { } int pty_resize(Pty *pty, unsigned short term_width, unsigned short term_height) { - struct winsize ws; + struct winsize ws = { + .ws_col = term_width, + .ws_row = term_height, + }; assert_return(pty, -EINVAL); assert_return(pty_is_open(pty), -ENODEV); assert_return(pty_is_parent(pty), -ENODEV); - zero(ws); - ws.ws_col = term_width; - ws.ws_row = term_height; - /* * This will send SIGWINCH to the pty slave foreground process group. * We will also get one, but we don't need it.