summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>1995-01-26 06:29:18 +0000
committerRoland McGrath <roland@redhat.com>1995-01-26 06:29:18 +0000
commit3fb9ebf83fab981420d24865a4076496c2e20d7d (patch)
treea32b1192d81a25f660cb9c0cbcc174af2ffeaca5 /main.c
parentb4890bdb1c6d8c21065ea6ab12973b6d579b0d65 (diff)
downloadgunmake-3fb9ebf83fab981420d24865a4076496c2e20d7d.tar.gz
(debug_signal_handler): New function; toggles debug_flag.
(main): Handle SIGUSR1 with that.
Diffstat (limited to 'main.c')
-rw-r--r--main.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/main.c b/main.c
index 18d5d7b..de9b833 100644
--- a/main.c
+++ b/main.c
@@ -397,6 +397,15 @@ enter_command_line_file (name)
return enter_file (savestring (name, strlen (name)));
}
+/* Toggle -d on receipt of SIGUSR1. */
+
+static RETSIGTYPE
+debug_signal_handler (sig)
+ int sig;
+{
+ debug_flag = ! debug_flag;
+}
+
int
main (argc, argv, envp)
int argc;
@@ -744,6 +753,11 @@ main (argc, argv, envp)
(void) signal (SIGCLD, child_handler);
#endif
+ /* Let the user send us SIGUSR1 to toggle the -d flag during the run. */
+#ifdef SIGUSR1
+ (void) signal (SIGUSR1, debug_signal_handler);
+#endif
+
/* Define the initial list of suffixes for old-style rules. */
set_default_suffixes ();