sig_atomic_t isn't necessarily compatible with the %d printf format,
so cast to int before printing. The value appears to be either 1 or 2, so no information should be lost this way.
This commit is contained in:
parent
35a9dd4fdd
commit
dc60e3b6f4
@ -55,7 +55,7 @@ main(void)
|
||||
if (flag == 2)
|
||||
printf("Success: Both handlers ran in order\n");
|
||||
else {
|
||||
printf("Failure: flag was %d\n", flag);
|
||||
printf("Failure: flag was %d\n", (int)flag);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,8 @@ threadroutine(void *arg)
|
||||
if (flag == 2)
|
||||
printf("Success: Both handlers ran in order\n");
|
||||
else {
|
||||
printf("Failure: flag was %d, flag2 was %d\n", flag, flag2);
|
||||
printf("Failure: flag was %d, flag2 was %d\n",
|
||||
(int)flag, (int)flag2);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user