[PATCH V2 06/11] NaCl: Detect systems that don't support statfs()

Kevin Cernekee cernekee at gmail.com
Mon Feb 8 22:34:12 PST 2016


This is missing on Chrome's Native Client (NaCl) because NaCl doesn't
really have (traditional) filesystems.

Signed-off-by: Kevin Cernekee <cernekee at gmail.com>
---
 configure.ac | 1 +
 ssl.c        | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 77fc9f1722e2..55076b1c09ac 100644
--- a/configure.ac
+++ b/configure.ac
@@ -113,6 +113,7 @@ AC_DEFINE_UNQUOTED(DEFAULT_VPNCSCRIPT, "${with_vpnc_script}", [Default vpnc-scri
 AC_SUBST(DEFAULT_VPNCSCRIPT, "${with_vpnc_script}")
 
 AC_CHECK_FUNC(fdevname_r, [AC_DEFINE(HAVE_FDEVNAME_R, 1, [Have fdevname_r() function])], [])
+AC_CHECK_FUNC(statfs, [AC_DEFINE(HAVE_STATFS, 1, [Have statfs() function])], [])
 AC_CHECK_FUNC(getline, [AC_DEFINE(HAVE_GETLINE, 1, [Have getline() function])],
     [symver_getline="openconnect__getline;"])
 AC_CHECK_FUNC(strcasestr, [AC_DEFINE(HAVE_STRCASESTR, 1, [Have strcasestr() function])], [])
diff --git a/ssl.c b/ssl.c
index 30a249444a5a..21d90ade8fc1 100644
--- a/ssl.c
+++ b/ssl.c
@@ -575,7 +575,7 @@ int openconnect_passphrase_from_fsid(struct openconnect_info *vpninfo)
 
 	return 0;
 }
-#else
+#elif defined(HAVE_STATFS)
 int openconnect_passphrase_from_fsid(struct openconnect_info *vpninfo)
 {
 	char *sslkey = openconnect_utf8_to_legacy(vpninfo, vpninfo->sslkey);
@@ -601,6 +601,11 @@ int openconnect_passphrase_from_fsid(struct openconnect_info *vpninfo)
 
 	return err;
 }
+#else
+int openconnect_passphrase_from_fsid(struct openconnect_info *vpninfo)
+{
+	return -EOPNOTSUPP;
+}
 #endif
 
 #if defined(OPENCONNECT_OPENSSL) || defined(DTLS_OPENSSL)
-- 
2.7.0




More information about the openconnect-devel mailing list