mirror of
https://github.com/NixOS/nix
synced 2025-06-27 00:11:17 +02:00
implement SysError errno handling
This commit is contained in:
parent
7ffb5efdbc
commit
e76ad2e48a
5 changed files with 21 additions and 19 deletions
|
@ -312,7 +312,8 @@ string readFile(const Path & path, bool drain)
|
|||
void readFile(const Path & path, Sink & sink)
|
||||
{
|
||||
AutoCloseFD fd = open(path.c_str(), O_RDONLY | O_CLOEXEC);
|
||||
if (!fd) throw SysError("opening file '%s'", path);
|
||||
if (!fd)
|
||||
throw SysError("opening file '%s'", path);
|
||||
drainFD(fd.get(), sink);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue