2021-03-19 Holger Berger <holger.berger@googlemail.com>
gold/
PR gold/26541
* output.cc (gold_fallocate): Use errno when calling system fallocate.
+2021-03-19 Holger Berger <holger.berger@googlemail.com>
+
+ PR gold/26541
+ * output.cc (gold_fallocate): Use errno when calling system fallocate.
+
2021-03-19 Cary Coutant <ccoutant@gmail.com>
PR gold/26585
#ifdef HAVE_FALLOCATE
{
+ errno = 0;
int err = ::fallocate(o, 0, offset, len);
- if (err != EINVAL && err != ENOSYS && err != EOPNOTSUPP)
- return err;
+ if (err < 0 && errno != EINVAL && errno != ENOSYS && errno != EOPNOTSUPP)
+ return errno;
}
#endif // defined(HAVE_FALLOCATE)
+ errno = 0;
if (::ftruncate(o, offset + len) < 0)
return errno;
return 0;