From aa368b7fc3de10150e53a6807658103cd935c6cf Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 4 Jun 2016 21:24:20 +0100 Subject: EIO makes more sense than ENOSYS when remote operations can't be performed --- netfs/fuse/fuseApp.cpp | 4 ++-- netfs/fuse/fuseAppBase.h | 2 +- netfs/unittests/testEdgeCases.cpp | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/netfs/fuse/fuseApp.cpp b/netfs/fuse/fuseApp.cpp index de75c6f..d4d7866 100644 --- a/netfs/fuse/fuseApp.cpp +++ b/netfs/fuse/fuseApp.cpp @@ -242,7 +242,7 @@ NetFS::FuseApp::onError(const std::exception & e) throw() return 0; } catch (...) { - return -ENOSYS; + return -EIO; } } if (dynamic_cast(&e)) { @@ -253,7 +253,7 @@ NetFS::FuseApp::onError(const std::exception & e) throw() return 0; } catch (...) { - return -ENOSYS; + return -EIO; } } if (dynamic_cast(&e)) { diff --git a/netfs/fuse/fuseAppBase.h b/netfs/fuse/fuseAppBase.h index 388ac5b..b044f99 100644 --- a/netfs/fuse/fuseAppBase.h +++ b/netfs/fuse/fuseAppBase.h @@ -160,7 +160,7 @@ class DLL_PUBLIC FuseAppBase { } catch (...) { fuseApp->logf(LOG_ERR, "Unknown exception calling %s", typeid(f).name()); - return -ENOSYS; + return -EIO; } } }; diff --git a/netfs/unittests/testEdgeCases.cpp b/netfs/unittests/testEdgeCases.cpp index 07ec86e..31cdf03 100644 --- a/netfs/unittests/testEdgeCases.cpp +++ b/netfs/unittests/testEdgeCases.cpp @@ -60,7 +60,7 @@ BOOST_AUTO_TEST_CASE( noDaemonAtStartUp ) }); struct statvfs s; - BOOST_REQUIRE_EQUAL(-ENOSYS, fuse.fuse->statfs("/", &s)); + BOOST_REQUIRE_EQUAL(-EIO, fuse.fuse->statfs("/", &s)); MockDaemonHost daemon(testEndpoint, { "--NetFSD.ConfigPath=" + (rootDir / "defaultDaemon.xml").string() }); @@ -82,7 +82,7 @@ BOOST_AUTO_TEST_CASE ( daemonUnavailableAfterUse ) BOOST_REQUIRE_EQUAL(0, fuse.fuse->statfs("/", &s)); } - BOOST_REQUIRE_EQUAL(-ENOSYS, fuse.fuse->statfs("/", &s)); + BOOST_REQUIRE_EQUAL(-EIO, fuse.fuse->statfs("/", &s)); { MockDaemonHost daemon(testEndpoint, { "--NetFSD.ConfigPath=" + (rootDir / "defaultDaemon.xml").string() @@ -90,6 +90,6 @@ BOOST_AUTO_TEST_CASE ( daemonUnavailableAfterUse ) BOOST_REQUIRE_EQUAL(0, fuse.fuse->statfs("/", &s)); } - BOOST_REQUIRE_EQUAL(-ENOSYS, fuse.fuse->statfs("/", &s)); + BOOST_REQUIRE_EQUAL(-EIO, fuse.fuse->statfs("/", &s)); } -- cgit v1.2.3