Skip to content

Commit 4492632

Browse files
authored
[lldb-dap] Do not take ownership of stdin. (#133811)
There isn't any benefit to taking ownership of stdin and it may cause issues if `Transport` is dealloced.
1 parent 7793bae commit 4492632

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lldb/tools/lldb-dap/lldb-dap.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,9 +571,9 @@ int main(int argc, char *argv[]) {
571571
}
572572

573573
lldb::IOObjectSP input = std::make_shared<NativeFile>(
574-
fileno(stdin), File::eOpenOptionReadOnly, true);
574+
fileno(stdin), File::eOpenOptionReadOnly, NativeFile::Unowned);
575575
lldb::IOObjectSP output = std::make_shared<NativeFile>(
576-
stdout_fd, File::eOpenOptionWriteOnly, false);
576+
stdout_fd, File::eOpenOptionWriteOnly, NativeFile::Unowned);
577577

578578
constexpr llvm::StringLiteral client_name = "stdin/stdout";
579579
Transport transport(client_name, log.get(), input, output);

0 commit comments

Comments
 (0)