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:
he 2005-03-05 14:34:29 +00:00
parent 35a9dd4fdd
commit dc60e3b6f4
2 changed files with 3 additions and 2 deletions

View File

@ -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);
}

View File

@ -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);
}