0
0
mirror of https://github.com/termux/termux-packages.git synced 2024-11-27 06:18:57 +00:00
termux-packages/root-packages/nfs-utils/utils-mount-nfsumount.c.patch
2023-01-31 03:57:01 +00:00

28 lines
683 B
Diff

--- a/utils/mount/nfsumount.c
+++ b/utils/mount/nfsumount.c
@@ -222,6 +222,24 @@
{ NULL, 0, 0, 0 }
};
+#if defined __ANDROID__ && __ANDROID_API__ < 26
+#include <dlfcn.h>
+static char *hasmntopt(const struct mntent *__entry, const char *__option)
+{
+ static int initialized = 0;
+ static char *(*libc_impl)(const struct mntent *, const char *) = NULL;
+ if (!initialized) {
+ void *libc_handle = dlopen("libc.so", RTLD_NOW);
+ if (libc_handle != NULL)
+ libc_impl = dlsym(libc_handle, "hasmntopt");
+ initialized = 1;
+ }
+ if (libc_impl != NULL)
+ return libc_impl(__entry, __option);
+ return NULL;
+}
+#endif
+
int nfsumount(int argc, char *argv[])
{
int c, ret;