diff options
author | iedowse <iedowse@FreeBSD.org> | 2005-03-02 02:30:08 +0000 |
---|---|---|
committer | iedowse <iedowse@FreeBSD.org> | 2005-03-02 02:30:08 +0000 |
commit | 352e54a36d54c7a8fa00f23ecf81dee374a89f06 (patch) | |
tree | bf5cc6807b9b3743b1b093db90787332269cd041 /sbin/dump/tape.c | |
parent | e0e77927b6fd2967770e6421074ce27caca8c0f3 (diff) | |
download | FreeBSD-src-352e54a36d54c7a8fa00f23ecf81dee374a89f06.zip FreeBSD-src-352e54a36d54c7a8fa00f23ecf81dee374a89f06.tar.gz |
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.
Diffstat (limited to 'sbin/dump/tape.c')
-rw-r--r-- | sbin/dump/tape.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/dump/tape.c b/sbin/dump/tape.c index 490d3d9..913409f 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 */ |