summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2009-08-13 14:37:43 +0100
committerPádraig Brady <P@draigBrady.com>2009-08-13 16:06:50 +0100
commite4caea57759495847dc52f7a7d062500dd711a96 (patch)
tree179db10a2fd92ba9954dd5c41391c5f2ce038956
parentab274c428dbdb36b87c37b0045e8e6dc3585f04a (diff)
downloadcoreutils-e4caea57759495847dc52f7a7d062500dd711a96.tar.xz
dd: fix a signal handling race
* src/dd.c (main): Install the signal handlers at startup rather than just before the copy starts. In this way signals received before the copy (like during a slow truncate for e.g.) will be deferred and handled consistently. * THANKS: Add Bernhard's email address. * NEWS: Mention the fix. Reported by Bernhard Voelker.
-rw-r--r--NEWS3
-rw-r--r--THANKS1
-rw-r--r--src/dd.c4
3 files changed, 6 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 6df0d65a6..a88546d81 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,9 @@ GNU coreutils NEWS -*- outline -*-
dd's oflag=direct option now works even when the size of the input
is not a multiple of e.g., 512 bytes.
+ dd now handles signals consistently even when they're received
+ before data copying has started.
+
install runs faster again with SELinux enabled
[introduced in coreutils-7.0]
diff --git a/THANKS b/THANKS
index d3541ce81..bd078db1f 100644
--- a/THANKS
+++ b/THANKS
@@ -75,6 +75,7 @@ Bernd Melchers melchers@cis.fu-berlin.de
Bernhard Baehr bernhard.baehr@gmx.de
Bernhard Gabler bernhard@uni-koblenz.de
Bernhard Rosenkraenzer bero@redhat.de
+Bernhard Voelker bernhard.voelker@siemens-enterprise.com
Bert Deknuydt Bert.Deknuydt@esat.kuleuven.ac.be
Bert Wesarg bert.wesarg@googlemail.com
Bill Peters peters@gaffel.as.arizona.edu
diff --git a/src/dd.c b/src/dd.c
index d9e4c85b8..30bd8085c 100644
--- a/src/dd.c
+++ b/src/dd.c
@@ -1828,6 +1828,8 @@ main (int argc, char **argv)
int exit_status;
off_t offset;
+ install_signal_handlers ();
+
initialize_main (&argc, &argv);
set_program_name (argv[0]);
setlocale (LC_ALL, "");
@@ -1928,8 +1930,6 @@ main (int argc, char **argv)
}
}
- install_signal_handlers ();
-
start_time = gethrxtime ();
exit_status = dd_copy ();