Re: [PATCH] Reset the terminal state if we are killed by a fatal signal.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Apr 06, 2008 at 12:15:46PM +0100, James Youngman wrote:
> -static struct termios termios;
> -static int termios_set = 0;
> +static volatile struct termios termios;

 Do we really need "volatile" here?

 -fsigned-char -fno-common -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2
 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64
 -mtune=generic


 fsck.minix.c: In function �reset�:
 fsck.minix.c:185: warning: passing argument 3 of �tcsetattr� discards
 qualifiers from pointer target type
 fsck.minix.c: In function �main�:
 fsck.minix.c:1353: warning: passing argument 2 of �tcgetattr�
 discards qualifiers from pointer target type
 fsck.minix.c:1403: warning: passing argument 3 of �tcsetattr�
 discards qualifiers from pointer target type

> +static void 
> +fatalsig(int sig) {
> +	/* We received a fatal signal.  Reset the terminal.
> +	 * Also reset the signal handler and re-send the signal,
> +	 * so that the parent process knows which signal actually 
> +	 * caused our death.
> +	 */
> +  	signal(sig, SIG_DFL);

 You needn't to reset the handler to SIG_DFL. That's default behaviour
 when you define the handler by signal(2).

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux