From db328640c867eaf3b4ea0ef6817c797e533bdc84 Mon Sep 17 00:00:00 2001 From: Nick Peng Date: Sat, 25 Jun 2022 20:25:20 +0800 Subject: [PATCH] tlog: fix dead lock when forking --- src/tlog.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tlog.c b/src/tlog.c index 3cb5992..b29f38a 100644 --- a/src/tlog.c +++ b/src/tlog.c @@ -929,6 +929,11 @@ static void _tlog_close_all_fd(void) struct dirent *ent; int dir_fd = -1; +#ifndef __USE_POSIX + /* patch for musl, may cause deadlock when call readdir */ + goto errout; +#endif + snprintf(path_name, sizeof(path_name), "/proc/self/fd/"); dir = opendir(path_name); if (dir == NULL) {