[haiku-3rdparty-dev] Re: How to detect if a shutdown is in progress?

  • From: Brian Hill <perelandra777@xxxxxxxxx>
  • To: haiku-3rdparty-dev@xxxxxxxxxxxxx
  • Date: Wed, 1 Feb 2012 19:45:53 -0500

On Jan 29, 2012, at 9:09 PM, Ingo Weinhold wrote:

> Using private API isn't that good an idea, since it can change at any time. I 
> suppose you could use the same strategy just with public API, i.e. 
> BRoster::Launch() your daemon (which would have to be single/exclusive 
> launch, so it isn't actually run again). 
Agreed, using private API isn't really the best way.  I was able to use the 
Launch command to run the 'true' binary and get the return status and check if 
it is B_SHUTTING_DOWN.  If the system isn't shutting down, true is run but it 
does nothing and quits.  I don't really like all the processing that goes into 
registering and launching a binary just to check the shutdown status, but it 
does work.


> 
> The preferred way would be to add a BRoster::IsShuttingDown() of course. 
> Again, patches welcome. :-)
If I ever get a dev Haiku system running I will certainly do so.

-Brian

Other related posts: