From fc8c0e410697928d644f06dea772b51c3abc0e3f Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 14 Jun 2017 17:56:49 +0300 Subject: Add support for ln testscript builtin --- build2/cc/windows-rpath.cxx | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'build2/cc/windows-rpath.cxx') diff --git a/build2/cc/windows-rpath.cxx b/build2/cc/windows-rpath.cxx index 0078944..450a0f5 100644 --- a/build2/cc/windows-rpath.cxx +++ b/build2/cc/windows-rpath.cxx @@ -315,13 +315,13 @@ namespace build2 } catch (const system_error& e) { - // Make sure that the error denotes errno portable code. + // Note that we are not guaranteed (here and below) that the + // system_error exception is of the generic category. // - assert (e.code ().category () == generic_category ()); - int c (e.code ().value ()); - - if (c != EPERM && c != ENOSYS) + if (!(e.code ().category () == generic_category () && + (c == ENOSYS || // Not implemented. + c == EPERM))) // Not supported by the filesystem(s). { print ("ln -s"); fail << "unable to create symlink " << l << ": " << e; @@ -334,13 +334,11 @@ namespace build2 } catch (const system_error& e) { - // Make sure the error reflects errno portable code. - // - assert (e.code ().category () == generic_category ()); - - int c (e.code ().value ()); - - if (c != EPERM && c != ENOSYS) + c = e.code ().value (); + if (!(e.code ().category () == generic_category () && + (c == ENOSYS || // Not implemented. + c == EPERM || // Not supported by the filesystem(s). + c == EXDEV))) // On different filesystems. { print ("ln"); fail << "unable to create hardlink " << l << ": " << e; -- cgit v1.1