unbreak heap checker unittest on systems without execinfo.h

I.e. musl
This commit is contained in:
Aliaksei Kandratsenka 2024-09-25 17:11:02 -04:00
parent 3cc9014c57
commit 6aecbbdb6b
1 changed files with 7 additions and 0 deletions

View File

@ -63,7 +63,11 @@
#include <gperftools/heap-checker.h>
#include <errno.h>
#ifdef HAVE_EXECINFO_H
#include <execinfo.h> // backtrace
#endif
#include <fcntl.h>
#include <grp.h> // getgrent, getgrnam
#include <poll.h>
@ -824,8 +828,11 @@ static void TestLibCAllocate() {
strerror(errno);
const time_t now = time(NULL);
ctime(&now);
#ifdef HAVE_EXECINFO_H
void *stack[1];
backtrace(stack, 1);
#endif
if (grplock.TryLock()) {
gid_t gid = getgid();