Skip to content

Commit

Permalink
lxclock: cleanup dump_stacktrace()
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Dec 10, 2020
1 parent e442322 commit e00c91e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/lxc/lxclock.c
Expand Up @@ -36,15 +36,14 @@ static inline void dump_stacktrace(void)
void *array[MAX_STACKDEPTH];
size_t size;
char **strings;
size_t i;

size = backtrace(array, MAX_STACKDEPTH);
strings = backtrace_symbols(array, size);

/* Using fprintf here as our logging module is not thread safe. */
fprintf(stderr, "\tObtained %zu stack frames\n", size);

for (i = 0; i < size; i++)
for (int i = 0; i < size; i++)
fprintf(stderr, "\t\t%s\n", strings[i]);

free(strings);
Expand Down

0 comments on commit e00c91e

Please sign in to comment.