1.1 --- a/libexec/lib/src/process_monitor.cc Fri Jan 26 00:32:35 2024 +0100
1.2 +++ b/libexec/lib/src/process_monitor.cc Sun Feb 18 00:51:52 2024 +0100
1.3 @@ -1,7 +1,7 @@
1.4 /*
1.5 * A process monitor abstraction.
1.6 *
1.7 - * Copyright (C) 2022, 2023 Paul Boddie <paul@boddie.org.uk>
1.8 + * Copyright (C) 2022, 2023, 2024 Paul Boddie <paul@boddie.org.uk>
1.9 *
1.10 * This program is free software; you can redistribute it and/or
1.11 * modify it under the terms of the GNU General Public License as
1.12 @@ -34,8 +34,8 @@
1.13
1.14 /* A process monitor receiving signals from a task. */
1.15
1.16 -ProcessMonitor::ProcessMonitor()
1.17 -: NotificationSupport()
1.18 +ProcessMonitor::ProcessMonitor(bool debug)
1.19 +: NotificationSupport(), _debug(debug)
1.20 {
1.21 }
1.22
1.23 @@ -50,7 +50,8 @@
1.24
1.25 void ProcessMonitor::close()
1.26 {
1.27 - printf("Process monitor closing...\n");
1.28 + if (_debug)
1.29 + printf("Process monitor closing...\n");
1.30 }
1.31
1.32
1.33 @@ -123,7 +124,8 @@
1.34
1.35 if (sig == 0)
1.36 {
1.37 - printf("Signal from task.\n");
1.38 + if (_debug)
1.39 + printf("Signal from task.\n");
1.40
1.41 /* Cancel any IPC to avoid spurious pager warnings. */
1.42