userland: Reduce debug_sym error messages

There are several reasons why /dev/fb0 might not exist, none of them
worrying, and the debug_sym library has fallbacks for those cases.
Suppress error messages for the ENOENT case, and only print one
message for other errors (unless the error keeps changing, which is
unlikely).

See: https://forums.raspberrypi.com/viewtopic.php?f=98&t=322238
This commit is contained in:
Phil Elwell
2021-10-25 13:45:47 +01:00
committed by Dom Cobley
parent 6e8f786db2
commit 7f72bc257d

View File

@@ -152,6 +152,7 @@ static int vc_mem_copy(void *dst, uint32_t src, uint32_t length)
const char *filename = "/dev/fb0";
int memFd;
struct fb_dmacopy ioparam;
static int expected_error = ENOENT;
ioparam.dst = dst;
ioparam.src = src;
@@ -159,7 +160,10 @@ static int vc_mem_copy(void *dst, uint32_t src, uint32_t length)
if (( memFd = open( filename, O_RDWR | O_SYNC )) < 0 )
{
ERR( "Unable to open '%s': %s(%d)\n", filename, strerror( errno ), errno );
if (errno != expected_error)
ERR( "Unable to open '%s': %s(%d)\n", filename,
strerror( errno ), errno );
expected_error = errno;
return -errno;
}