aboutsummaryrefslogtreecommitdiffstats
path: root/libc/bionic/mntent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libc/bionic/mntent.cpp')
-rw-r--r--libc/bionic/mntent.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/libc/bionic/mntent.cpp b/libc/bionic/mntent.cpp
index 4afacda60..d169e2930 100644
--- a/libc/bionic/mntent.cpp
+++ b/libc/bionic/mntent.cpp
@@ -31,14 +31,13 @@
#include "private/ThreadLocalBuffer.h"
-GLOBAL_INIT_THREAD_LOCAL_BUFFER(getmntent_mntent);
-GLOBAL_INIT_THREAD_LOCAL_BUFFER(getmntent_strings);
+static ThreadLocalBuffer<mntent> g_getmntent_mntent_tls_buffer;
+static ThreadLocalBuffer<char, BUFSIZ> g_getmntent_strings_tls_buffer;
mntent* getmntent(FILE* fp) {
- LOCAL_INIT_THREAD_LOCAL_BUFFER(mntent*, getmntent_mntent, sizeof(mntent));
- LOCAL_INIT_THREAD_LOCAL_BUFFER(char*, getmntent_strings, BUFSIZ);
- return getmntent_r(fp, getmntent_mntent_tls_buffer,
- getmntent_strings_tls_buffer, getmntent_strings_tls_buffer_size);
+ return getmntent_r(fp, g_getmntent_mntent_tls_buffer.get(),
+ g_getmntent_strings_tls_buffer.get(),
+ g_getmntent_strings_tls_buffer.size());
}
mntent* getmntent_r(FILE* fp, struct mntent* e, char* buf, int buf_len) {