On 09/15/11 21:44, Peter Maydell wrote:
On 15 September 2011 18:22, Laszlo Ersek<ler...@redhat.com>  wrote:
-int no_shutdown = 0;
+volatile int no_shutdown = 0;

So why 'volatile' and not 'sig_atomic_t', then?

The sigaction() spec says"volatile sig_atomic_t", so that would be ideal. My assumption was that "sig_atomic_t" (which is allowed by POSIX not to be wider than "char") would be in practice at least as wide as "int" and "pid_t". Should my assumption be wrong on some platforms, qualifying the variables "volatile" while keeping their current types (int / pid_t) does less damage (no damage) than narrowing their types.

lacos

Reply via email to