aboutsummaryrefslogtreecommitdiff
path: root/build2/cc/windows-rpath.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-06-14 17:56:49 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-06-15 21:08:07 +0300
commitfc8c0e410697928d644f06dea772b51c3abc0e3f (patch)
treee136e0d5e3df77ef65818ea94fee1bdced9a074f /build2/cc/windows-rpath.cxx
parent87f97db9d5dbe2aefbeb6c49c4bb65aa3b8afbc7 (diff)
Add support for ln testscript builtin
Diffstat (limited to 'build2/cc/windows-rpath.cxx')
-rw-r--r--build2/cc/windows-rpath.cxx22
1 files changed, 10 insertions, 12 deletions
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;