]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libbacktrace/posix.c
Add AMD znver5 processor enablement with scheduler model
[thirdparty/gcc.git] / libbacktrace / posix.c
index baffb85b04d221e9acde80bcbe0e75a734e87444..79f4950f84b9048014239ca9568f752431cdbb1e 100644 (file)
@@ -1,5 +1,5 @@
 /* posix.c -- POSIX file I/O routines for the backtrace library.
-   Copyright (C) 2012-2019 Free Software Foundation, Inc.
+   Copyright (C) 2012-2024 Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Google.
 
 Redistribution and use in source and binary forms, with or without
@@ -67,7 +67,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);