Skip to content

Commit 07d7967

Browse files
mdouchaacerv
authored andcommitted
flock07: Initialize the sigaction structure
The sigaction structure for child SIGUSR1 handler was uninitialized, which sometimes resulted in SA_RESTART flag being enabled by accident and the child flock() call never returning. Make sure the sigaction structure is properly initialized. Signed-off-by: Martin Doucha <[email protected]> Reviewed-by: Avinesh Kumar <[email protected]> Reviewed-by: Andrea Cervesato <[email protected]>
1 parent 5156f72 commit 07d7967

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

testcases/kernel/syscalls/flock/flock07.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ static void cleanup(void)
4242

4343
static void child_do(int fd)
4444
{
45-
struct sigaction sa;
45+
struct sigaction sa = {};
4646

4747
sa.sa_handler = handler;
4848
SAFE_SIGEMPTYSET(&sa.sa_mask);

0 commit comments

Comments
 (0)