From: Lennart Poettering Date: Wed, 14 Jan 2015 01:22:27 +0000 (+0100) Subject: pty: minor modernization X-Git-Tag: v219~509 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=aa0fff7f9c9fce89210ec764dd892afbdc28c571;hp=01b725684f6ba54f0db815669e4e07eb0e02fedb;p=elogind.git pty: minor modernization We initialize structs during declartion if possible --- diff --git a/src/shared/pty.c b/src/shared/pty.c index 6863be654..fbe6295ea 100644 --- a/src/shared/pty.c +++ b/src/shared/pty.c @@ -550,16 +550,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.