aboutsummaryrefslogtreecommitdiff
path: root/gdb/ui-file.h
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2022-11-17 09:09:59 -0700
committerTom Tromey <tromey@adacore.com>2022-11-28 13:22:40 -0700
commit2b141965f2ddef8cf3e79d357768a98c8703a5df (patch)
tree717f4e830e5feda928ea4202711e3079a3ec4515 /gdb/ui-file.h
parent19622df10dd5a8d3567e79d0661770029e4fbcfe (diff)
downloadfsf-binutils-gdb-2b141965f2ddef8cf3e79d357768a98c8703a5df.zip
fsf-binutils-gdb-2b141965f2ddef8cf3e79d357768a98c8703a5df.tar.gz
fsf-binutils-gdb-2b141965f2ddef8cf3e79d357768a98c8703a5df.tar.bz2
Don't let tee_file own a stream
Right now, tee_file owns the second stream it writes to. This is done for the convenience of the users. In a subsequent patch, this will no longer be convenient, so this patch moves the responsibility for ownership to the users of tee_file.
Diffstat (limited to 'gdb/ui-file.h')
-rw-r--r--gdb/ui-file.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/ui-file.h b/gdb/ui-file.h
index e33ae79..4a006bb 100644
--- a/gdb/ui-file.h
+++ b/gdb/ui-file.h
@@ -329,9 +329,9 @@ public:
class tee_file : public ui_file
{
public:
- /* Create a file which writes to both ONE and TWO. ONE will remain
- open when this object is destroyed; but TWO will be closed. */
- tee_file (ui_file *one, ui_file_up &&two);
+ /* Create a file which writes to both ONE and TWO. Ownership of
+ both files is up to the user. */
+ tee_file (ui_file *one, ui_file *two);
~tee_file () override;
void write (const char *buf, long length_buf) override;
@@ -364,7 +364,7 @@ public:
private:
/* The two underlying ui_files. */
ui_file *m_one;
- ui_file_up m_two;
+ ui_file *m_two;
};
/* A ui_file implementation that filters out terminal escape