1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Backport some fixes from libbacktrace upstream repo.

This commit is contained in:
Bartosz Taudul
2020-05-30 14:23:29 +02:00
parent 71102e3c6d
commit ff27656533
2 changed files with 8 additions and 1 deletions
+5 -1
View File
@@ -70,7 +70,11 @@ backtrace_open (const char *filename, backtrace_error_callback error_callback,
descriptor = open (filename, (int) (O_RDONLY | O_BINARY | O_CLOEXEC));
if (descriptor < 0)
{
if (does_not_exist != NULL && errno == ENOENT)
/* If DOES_NOT_EXIST is not NULL, then don't call ERROR_CALLBACK
if the file does not exist. We treat lacking permission to
open the file as the file not existing; this case arises when
running the libgo syscall package tests as root. */
if (does_not_exist != NULL && (errno == ENOENT || errno == EACCES))
*does_not_exist = 1;
else
error_callback (data, filename, errno);