Skip to content

Commit

Permalink
vdso: Fix signal handling
Browse files Browse the repository at this point in the history
Signed-off-by: Geoff Levand <[email protected]>
  • Loading branch information
glevand committed Mar 20, 2020
1 parent 907d6cc commit 446dc0c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/vdso-tests/vdso-basic-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,12 @@ static int test_gettimeofday(void)
*
*/

static int alarm_event;
static volatile sig_atomic_t alarm_event;

static void SIGALRM_handler(int __attribute__((unused)) signum)
static void SIGALRM_handler(int signum)
{
fflush(stdout);
printf("\n%s\n", __func__);
fflush(stdout);
alarm_event = 1;
signal(signum, SIGALRM_handler);
}

static void alpha_print(char c, unsigned limit)
Expand All @@ -196,6 +194,9 @@ static void alpha_print(char c, unsigned limit)
fprintf(stderr, "%c", c + i);
fflush(stderr);
if (alarm_event) {
fflush(stdout);
printf("alarm_event\n");
fflush(stdout);
return;
}
}
Expand Down

0 comments on commit 446dc0c

Please sign in to comment.