pty: minor modernization

We initialize structs during declartion if possible
This commit is contained in:
Lennart Poettering
2015-01-14 23:18:33 +01:00
parent 01b725684f
commit aa0fff7f9c
+4 -5
View File
@@ -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.