app_server: Fix potential infinite loop

Return `B_ENTRY_NOT_FOUND` instead of -1 when `/dev/graphics`
is not found.

Otherwise, `app_server` would run into an infinite loop
while waiting `fCardFD` to equal `B_ENTRY_NOT_FOUND` in some
specific environments such as a `chroot` where `/dev` is missing.

Change-Id: Ice23a82f58811f1258c58826c2488ae5c5c29cee
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6376
Reviewed-by: X512 <danger_mail@list.ru>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
This commit is contained in:
Trung Nguyen 2023-04-16 18:21:51 +10:00 committed by Jérôme Duval
parent b5ff580afb
commit 50a5eed083
2 changed files with 2 additions and 2 deletions

View File

@ -239,7 +239,7 @@ AccelerantHWInterface::_OpenGraphicsDevice(int deviceNumber)
if (!use_fail_safe_video_mode()) {
DIR *directory = opendir("/dev/graphics");
if (!directory)
return -1;
return B_ENTRY_NOT_FOUND;
struct dirent *entry;
char path[PATH_MAX];

View File

@ -407,7 +407,7 @@ DWindowHWInterface::_OpenGraphicsDevice(int deviceNumber)
{
DIR *directory = opendir("/dev/graphics");
if (!directory)
return -1;
return B_ENTRY_NOT_FOUND;
// TODO: We do not need to avoid the "vesa" or "framebuffer" drivers this way
// once they been ported to the new driver architecture - the special case here