mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-09-06 21:51:37 +00:00
pty: minor modernization
We initialize structs during declartion if possible
This commit is contained in:
+4
-5
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user