Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/nix/cat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ struct CmdCatNar : StoreCommand, MixCat
void run(ref<Store> store) override
{
AutoCloseFD fd = open(narPath.c_str(), O_RDONLY);
if (!fd)
throw SysError("opening NAR file '%s'", narPath);
auto source = FdSource{fd.get()};
auto narAccessor = makeNarAccessor(source);
auto listing = listNar(narAccessor, CanonPath::root, true);
Expand Down
2 changes: 2 additions & 0 deletions src/nix/ls.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ struct CmdLsNar : Command, MixLs
void run() override
{
AutoCloseFD fd = open(narPath.c_str(), O_RDONLY);
if (!fd)
throw SysError("opening NAR file '%s'", narPath);
auto source = FdSource{fd.get()};
auto narAccessor = makeNarAccessor(source);
auto listing = listNar(narAccessor, CanonPath::root, true);
Expand Down
Loading