Recent

Author Topic: [Solved] Handle SIGTERM in Lazarus app  (Read 2437 times)

MarkMLl

  • Hero Member
  • *****
  • Posts: 8504
Re: killall with GUI app
« Reply #15 on: April 04, 2025, 10:15:40 am »
However: /why/ are you using SIGTERM? SIGINT (by default raised by ^C) is far more common for this sort of thing.

Because SIGTERM is the default signal of kill or killall maybe? And users might use that to terminate AlexTP's application if need be.

Yes, but it's far more common to hook SIGINT due to its being raised by ^C etc., or to hook both signals (which can be distinguished in the handler if necessary).

Mark, that example was less useful for me. AI's example (2nd one) was better and shorter 3x times.

But you then went and posted AI-generated code into the forum despite knowing it wasn't quite right, which other AIs will assume is correct and reproduce.

That's my last contribution to this thread.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

AlexTP

  • Hero Member
  • *****
  • Posts: 2615
    • UVviewsoft
Re: [Solved] Handle SIGTERM in Lazarus app
« Reply #16 on: April 04, 2025, 10:24:05 am »
Wrong AI code was posted by mistake, sorry, I deleted that code.

Zvoni

  • Hero Member
  • *****
  • Posts: 3135
Re: [Solved] Handle SIGTERM in Lazarus app
« Reply #17 on: April 04, 2025, 11:36:48 am »
Last bit of nitpicking (regarding posted Solution):
Calling a Variable "New" is....err....do i really have to go into detail?
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

jamie

  • Hero Member
  • *****
  • Posts: 7300
Re: [Solved] Handle SIGTERM in Lazarus app
« Reply #18 on: April 04, 2025, 07:27:22 pm »
That's what you get for doing AI garbage.

I don't do Linux programming but shouldn't the new variable be in global space not in a local procedure?

Jamie
The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018