mirror of
https://github.com/rui314/mold.git
synced 2024-10-05 09:07:10 +03:00
Merge pull request #274 from akawashiro/show-errno
Show errno for ftruncate and fchmod
This commit is contained in:
commit
e6d1d011ef
@ -39,10 +39,10 @@ public:
|
||||
}
|
||||
|
||||
if (ftruncate(fd, filesize))
|
||||
Fatal(ctx) << "ftruncate failed";
|
||||
Fatal(ctx) << "ftruncate failed: " << errno_string();
|
||||
|
||||
if (fchmod(fd, (perm & ~get_umask())) == -1)
|
||||
Fatal(ctx) << "fchmod failed";
|
||||
Fatal(ctx) << "fchmod failed: " << errno_string();
|
||||
|
||||
this->buf = (u8 *)mmap(nullptr, filesize, PROT_READ | PROT_WRITE,
|
||||
MAP_SHARED, fd, 0);
|
||||
|
@ -32,9 +32,9 @@ public:
|
||||
Fatal(ctx) << "cannot open " << output_tmpfile << ": " << errno_string();
|
||||
|
||||
if (ftruncate(fd, filesize))
|
||||
Fatal(ctx) << "ftruncate failed";
|
||||
Fatal(ctx) << "ftruncate failed: " << errno_string();
|
||||
if (fchmod(fd, perm) == -1)
|
||||
Fatal(ctx) << "fchmod failed";
|
||||
Fatal(ctx) << "fchmod failed: " << errno_string();
|
||||
|
||||
this->buf = (u8 *)mmap(nullptr, filesize, PROT_READ | PROT_WRITE,
|
||||
MAP_SHARED, fd, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user