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 <[email protected]> Tested-by: Commit checker robot <[email protected]> Reviewed-by: Jérôme Duval <[email protected]>
This commit is contained in:
committed by
Jérôme Duval
parent
b5ff580afb
commit
50a5eed083
@@ -239,7 +239,7 @@ AccelerantHWInterface::_OpenGraphicsDevice(int deviceNumber)
|
|||||||
if (!use_fail_safe_video_mode()) {
|
if (!use_fail_safe_video_mode()) {
|
||||||
DIR *directory = opendir("/dev/graphics");
|
DIR *directory = opendir("/dev/graphics");
|
||||||
if (!directory)
|
if (!directory)
|
||||||
return -1;
|
return B_ENTRY_NOT_FOUND;
|
||||||
|
|
||||||
struct dirent *entry;
|
struct dirent *entry;
|
||||||
char path[PATH_MAX];
|
char path[PATH_MAX];
|
||||||
|
|||||||
@@ -407,7 +407,7 @@ DWindowHWInterface::_OpenGraphicsDevice(int deviceNumber)
|
|||||||
{
|
{
|
||||||
DIR *directory = opendir("/dev/graphics");
|
DIR *directory = opendir("/dev/graphics");
|
||||||
if (!directory)
|
if (!directory)
|
||||||
return -1;
|
return B_ENTRY_NOT_FOUND;
|
||||||
|
|
||||||
// TODO: We do not need to avoid the "vesa" or "framebuffer" drivers this way
|
// 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
|
// once they been ported to the new driver architecture - the special case here
|
||||||
|
|||||||
Reference in New Issue
Block a user