* fixes a warning

* try to launch screen_blanker by path when a launch by signature fails.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37120 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval 2010-06-12 17:47:47 +00:00
parent 8dbd2b6cea
commit 3f0827a2d1

View File

@ -14,6 +14,7 @@
#include <Application.h>
#include <Autolock.h>
#include <FindDirectory.h>
#include <MessageRunner.h>
#include <NodeMonitor.h>
#include <OS.h>
@ -172,7 +173,7 @@ ScreenSaverFilter::_WatchSettings()
void
ScreenSaverFilter::_Invoke()
{
if (fCurrentCorner == fNeverBlankCorner && fNeverBlankCorner != NO_CORNER
if ((fCurrentCorner == fNeverBlankCorner && fNeverBlankCorner != NO_CORNER)
|| (fSettings.TimeFlags() & ENABLE_SAVER) == 0
|| fIsRunning
|| be_roster->IsRunning(SCREEN_BLANKER_SIG))
@ -183,6 +184,21 @@ ScreenSaverFilter::_Invoke()
// the blanker twice in any case.
fIsRunning = true;
}
// Try really hard to launch it. It's very likely that this fails,
// when we run from the CD and there is only an incomplete mime
// database for example...
BPath path;
if (find_directory(B_SYSTEM_BIN_DIRECTORY, &path) != B_OK
|| path.Append("screen_blanker") != B_OK) {
path.SetTo("/boot/system/bin/screen_blanker");
}
BEntry entry(path.Path());
entry_ref ref;
if (entry.GetRef(&ref) == B_OK
&& be_roster->Launch(&ref) == B_OK) {
fIsRunning = true;
}
}