test: don't use designated initializers

This change fixes compile errors:
pty.cc:1460:7: error: expected primary-expression before '.' token
...

PiperOrigin-RevId: 271033729
This commit is contained in:
Andrei Vagin 2019-09-24 19:03:26 -07:00 committed by gVisor bot
parent 502f8f238e
commit 2fb34c8d5c
2 changed files with 13 additions and 16 deletions

View File

@ -21,4 +21,5 @@ top_level=$(git rev-parse --show-toplevel 2>/dev/null)
make
make runsc
make BAZEL_OPTIONS="build //..." bazel
make bazel-shutdown

View File

@ -1292,10 +1292,9 @@ TEST_F(JobControlTest, ReleaseTTY) {
// Make sure we're ignoring SIGHUP, which will be sent to this process once we
// disconnect they TTY.
struct sigaction sa = {
.sa_handler = SIG_IGN,
.sa_flags = 0,
};
struct sigaction sa = {};
sa.sa_handler = SIG_IGN;
sa.sa_flags = 0;
sigemptyset(&sa.sa_mask);
struct sigaction old_sa;
EXPECT_THAT(sigaction(SIGHUP, &sa, &old_sa), SyscallSucceeds());
@ -1362,10 +1361,9 @@ TEST_F(JobControlTest, ReleaseTTYSignals) {
ASSERT_THAT(ioctl(slave_.get(), TIOCSCTTY, 0), SyscallSucceeds());
received = 0;
struct sigaction sa = {
.sa_handler = sig_handler,
.sa_flags = 0,
};
struct sigaction sa = {};
sa.sa_handler = sig_handler;
sa.sa_flags = 0;
sigemptyset(&sa.sa_mask);
sigaddset(&sa.sa_mask, SIGHUP);
sigaddset(&sa.sa_mask, SIGCONT);
@ -1403,10 +1401,9 @@ TEST_F(JobControlTest, ReleaseTTYSignals) {
// Make sure we're ignoring SIGHUP, which will be sent to this process once we
// disconnect they TTY.
struct sigaction sighup_sa = {
.sa_handler = SIG_IGN,
.sa_flags = 0,
};
struct sigaction sighup_sa = {};
sighup_sa.sa_handler = SIG_IGN;
sighup_sa.sa_flags = 0;
sigemptyset(&sighup_sa.sa_mask);
struct sigaction old_sa;
EXPECT_THAT(sigaction(SIGHUP, &sighup_sa, &old_sa), SyscallSucceeds());
@ -1456,10 +1453,9 @@ TEST_F(JobControlTest, SetForegroundProcessGroup) {
ASSERT_THAT(ioctl(slave_.get(), TIOCSCTTY, 0), SyscallSucceeds());
// Ignore SIGTTOU so that we don't stop ourself when calling tcsetpgrp.
struct sigaction sa = {
.sa_handler = SIG_IGN,
.sa_flags = 0,
};
struct sigaction sa = {};
sa.sa_handler = SIG_IGN;
sa.sa_flags = 0;
sigemptyset(&sa.sa_mask);
sigaction(SIGTTOU, &sa, NULL);