summaryrefslogtreecommitdiff
path: root/src/dd.c
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 /src/dd.c
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.
Diffstat (limited to 'src/dd.c')
-rw-r--r--src/dd.c4
1 files changed, 2 insertions, 2 deletions
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 ();