diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2016-06-04 21:24:20 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2016-06-04 21:24:20 +0100 |
commit | aa368b7fc3de10150e53a6807658103cd935c6cf (patch) | |
tree | c46ca15ea8321c157040fa6cd3ca6c37523b84ce | |
parent | Move libfusepp stuff into netfs, that's all it's gonna be used in (diff) | |
download | netfs-aa368b7fc3de10150e53a6807658103cd935c6cf.tar.bz2 netfs-aa368b7fc3de10150e53a6807658103cd935c6cf.tar.xz netfs-aa368b7fc3de10150e53a6807658103cd935c6cf.zip |
EIO makes more sense than ENOSYS when remote operations can't be performed
-rw-r--r-- | netfs/fuse/fuseApp.cpp | 4 | ||||
-rw-r--r-- | netfs/fuse/fuseAppBase.h | 2 | ||||
-rw-r--r-- | 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<const Ice::RequestFailedException *>(&e)) { @@ -253,7 +253,7 @@ NetFS::FuseApp::onError(const std::exception & e) throw() return 0; } catch (...) { - return -ENOSYS; + return -EIO; } } if (dynamic_cast<const NetFS::AuthError *>(&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)); } |