aboutsummaryrefslogtreecommitdiff
path: root/sbin/dump/tape.c
diff options
context:
space:
mode:
authorIan Dowse <iedowse@FreeBSD.org>2005-03-02 02:30:08 +0000
committerIan Dowse <iedowse@FreeBSD.org>2005-03-02 02:30:08 +0000
commit890005bf8a7ce36a8bfa4d95e3ea257fab31855d (patch)
treebf5cc6807b9b3743b1b093db90787332269cd041 /sbin/dump/tape.c
parented9e8cc51215d909e26a319d4909e4af184814d1 (diff)
downloadsrc-890005bf8a7ce36a8bfa4d95e3ea257fab31855d.tar.gz
src-890005bf8a7ce36a8bfa4d95e3ea257fab31855d.zip
Use a signal-safe type for two variables that are used to synchronise
with a signal handler. This fixes a race condition introduced by compiler reordering that caused dump to sometimes get stuck, especially while dumping large filesystems.
Notes
Notes: svn path=/head/; revision=142968
Diffstat (limited to 'sbin/dump/tape.c')
-rw-r--r--sbin/dump/tape.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/dump/tape.c b/sbin/dump/tape.c
index 490d3d97c351..913409fb7b01 100644
--- a/sbin/dump/tape.c
+++ b/sbin/dump/tape.c
@@ -109,8 +109,8 @@ char (*nextblock)[TP_BSIZE];
int master; /* pid of master, for sending error signals */
int tenths; /* length of tape used per block written */
-static int caught; /* have we caught the signal to proceed? */
-static int ready; /* have we reached the lock point without having */
+static volatile sig_atomic_t caught; /* have we caught the signal to proceed? */
+static volatile sig_atomic_t ready; /* reached the lock point without having */
/* received the SIGUSR2 signal from the prev slave? */
static jmp_buf jmpbuf; /* where to jump to if we are ready when the */
/* SIGUSR2 arrives from the previous slave */