Flags set in signal handlers should be volatile sig_atomic_t

From: Todd C. Miller <millert@cvs.openbsd.org>
This commit is contained in:
tg 2004-12-28 22:28:01 +00:00
parent 506319026b
commit cddaa62a46
3 changed files with 14 additions and 14 deletions

8
edit.c
View File

@ -1,5 +1,5 @@
/** $MirBSD: src/bin/ksh/edit.c,v 2.4 2004/12/18 19:22:28 tg Exp $ */
/* $OpenBSD: edit.c,v 1.18 2003/08/22 18:17:10 fgsch Exp $ */
/** $MirBSD: src/bin/ksh/edit.c,v 2.5 2004/12/28 22:28:01 tg Exp $ */
/* $OpenBSD: edit.c,v 1.23 2004/12/18 22:12:23 millert Exp $ */
/*
* Command line editing - common code
@ -21,11 +21,11 @@
#include <ctype.h>
#include "ksh_stat.h"
__RCSID("$MirBSD: src/bin/ksh/edit.c,v 2.4 2004/12/18 19:22:28 tg Exp $");
__RCSID("$MirBSD: src/bin/ksh/edit.c,v 2.5 2004/12/28 22:28:01 tg Exp $");
#if defined(TIOCGWINSZ)
static RETSIGTYPE x_sigwinch(int sig);
static int got_sigwinch;
static volatile sig_atomic_t got_sigwinch;
static void check_sigwinch(void);
#endif /* TIOCGWINSZ */

8
jobs.c
View File

@ -1,5 +1,5 @@
/** $MirBSD: src/bin/ksh/jobs.c,v 2.4 2004/12/18 19:22:29 tg Exp $ */
/* $OpenBSD: jobs.c,v 1.21 2003/11/10 21:26:39 millert Exp $ */
/** $MirBSD: src/bin/ksh/jobs.c,v 2.5 2004/12/28 22:28:01 tg Exp $ */
/* $OpenBSD: jobs.c,v 1.26 2004/12/18 22:12:23 millert Exp $ */
/*
* Process and job control
@ -31,7 +31,7 @@
#include "ksh_times.h"
#include "tty.h"
__RCSID("$MirBSD: src/bin/ksh/jobs.c,v 2.4 2004/12/18 19:22:29 tg Exp $");
__RCSID("$MirBSD: src/bin/ksh/jobs.c,v 2.5 2004/12/28 22:28:01 tg Exp $");
/* Start of system configuration stuff */
@ -181,7 +181,7 @@ static int child_max; /* CHILD_MAX */
#ifdef JOB_SIGS
/* held_sigchld is set if sigchld occurs before a job is completely started */
static int held_sigchld;
static volatile sig_atomic_t held_sigchld;
#endif /* JOB_SIGS */
#ifdef JOBS

12
sh.h
View File

@ -1,5 +1,5 @@
/** $MirBSD: src/bin/ksh/sh.h,v 2.6 2004/12/18 19:27:21 tg Exp $ */
/* $OpenBSD: sh.h,v 1.18 2004/05/31 10:36:35 otto Exp $ */
/** $MirBSD: src/bin/ksh/sh.h,v 2.7 2004/12/28 22:28:01 tg Exp $ */
/* $OpenBSD: sh.h,v 1.23 2004/12/18 22:11:43 millert Exp $ */
#ifndef SH_H
#define SH_H
@ -502,7 +502,7 @@ typedef struct trap {
const char *name; /* short name */
const char *mess; /* descriptive name */
char *trap; /* trap command */
int volatile set; /* trap pending */
volatile sig_atomic_t set; /* trap pending */
int flags; /* TF_* */
handler_t cursig; /* current handler (valid if TF_ORIG_* set) */
handler_t shtrap; /* shell signal handler */
@ -533,9 +533,9 @@ typedef struct trap {
#define SIGEXIT_ 0 /* for trap EXIT */
#define SIGERR_ SIGNALS /* for trap ERR */
EXTERN int volatile trap; /* traps pending? */
EXTERN int volatile intrsig; /* pending trap interrupts executing command */
EXTERN int volatile fatal_trap;/* received a fatal signal */
EXTERN volatile sig_atomic_t trap; /* traps pending? */
EXTERN volatile sig_atomic_t intrsig; /* pending trap interrupts executing command */
EXTERN volatile sig_atomic_t fatal_trap;/* received a fatal signal */
#ifndef FROM_TRAP_C
/* Kludge to avoid bogus re-declaration of sigtraps[] error on AIX 3.2.5 */
extern Trap sigtraps[SIGNALS+1];