Skip to content

Commit

Permalink
io/UniqueFileDescriptor: use AdoptTag in the constructors that adopt …
Browse files Browse the repository at this point in the history
…ownership
  • Loading branch information
MaxKellermann committed Jan 23, 2025
1 parent f29804d commit 17b12fe
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/io/FdCache.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ FdCache::Item::Start(FileDescriptor directory, std::size_t strip_length,
int _fd = openat2(directory.Get(), p,
&how, sizeof(how));
if (_fd >= 0) {
fd = UniqueFileDescriptor{_fd};
fd = UniqueFileDescriptor{AdoptTag{}, _fd};
RegisterInotify();
InvokeSuccess();
} else {
Expand Down
2 changes: 1 addition & 1 deletion test/run_was.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ try {
context.process = was_launch(spawn_service, nullptr, "was",
path, args,
child_options,
UniqueFileDescriptor(::dup(STDERR_FILENO)));
FileDescriptor{STDERR_FILENO}.Duplicate());
context.control.emplace(context.event_loop, context.process.control, context);

was_client_request(context.root_pool, nullptr,
Expand Down
4 changes: 2 additions & 2 deletions test/was_mirror.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ main(int, char **)

WasSocket socket{
UniqueSocketDescriptor{AdoptTag{}, 3},
UniqueFileDescriptor(STDIN_FILENO),
UniqueFileDescriptor(STDOUT_FILENO),
UniqueFileDescriptor{AdoptTag{}, STDIN_FILENO},
UniqueFileDescriptor{AdoptTag{}, STDOUT_FILENO},
};

Instance instance;
Expand Down

0 comments on commit 17b12fe

Please sign in to comment.