@@ -5531,7 +5531,7 @@ function RunCommand(const cmd: TFileName; waitfor: boolean;
5531
5531
// use the system code page or even UTF-16 binary with BOM (!) - so you
5532
5532
// may consider using AnsiToUtf8() with the proper code page
5533
5533
// - will optionally call onoutput() to notify the new output state
5534
- // - can abort if onoutput() callback returns false , or waitfordelayms expires
5534
+ // - aborts if onoutput() callback returns true , or waitfordelayms expires
5535
5535
// - optional env is Windows only, (FPC popen does not support it), and should
5536
5536
// be encoded as name=value#0 pairs
5537
5537
// - you can specify a wrkdir if the path specified by cmd is not good enough
@@ -5548,20 +5548,25 @@ function RunRedirect(const cmd: TFileName; exitcode: PInteger = nil;
5548
5548
5549
5549
{ $ifdef OSWINDOWS}
5550
5550
type
5551
- // / how in RunRedirect() or RunCommand() should try to gracefully terminate
5551
+ // / how RunRedirect() or RunCommand() should try to gracefully terminate
5552
5552
// - ramCtrlC calls CancelProcess(), i.e. send CTRL_C_EVENT
5553
5553
// - ramQuit calls QuitProcess(), i.e. send WM_QUIT on all the process threads
5554
+ // - note that TerminateProcess is always called after RunAbortTimeoutSecs
5555
+ // timeout, or if this set of methods is void
5554
5556
TRunAbortMethods = set of (ramCtrlC, ramQuit);
5555
5557
var
5556
5558
// / RunRedirect/RunCommand methods to gracefully terminate before TerminateProcess
5557
5559
RunAbortMethods: TRunAbortMethods = [ramCtrlC, ramQuit];
5558
5560
{ $else}
5559
5561
type
5560
- // / how in RunRedirect() should try to gracefully terminate
5561
- TRunAbortMethods = set of (ramSIGTERM);
5562
+ // / how RunRedirect() should try to gracefully terminate
5563
+ // - ramSigTerm send a fpkill(pid, SIGTERM) to the process
5564
+ // - note that SIGKILL is always sent after RunAbortTimeoutSecs timeout,
5565
+ // or if ramSigTerm was not supplied
5566
+ TRunAbortMethods = set of (ramSigTerm);
5562
5567
var
5563
5568
// / RunRedirect() methods to gracefully terminate before SIGKILL
5564
- RunAbortMethods: TRunAbortMethods = [ramSIGTERM ];
5569
+ RunAbortMethods: TRunAbortMethods = [ramSigTerm ];
5565
5570
{ $endif OSWINDOWS}
5566
5571
5567
5572
0 commit comments