This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA v2 02/24] Introduce and use gdb_file_up
- From: Simon Marchi <simon dot marchi at polymtl dot ca>
- To: Tom Tromey <tom at tromey dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Sun, 30 Jul 2017 01:40:22 +0200
- Subject: Re: [RFA v2 02/24] Introduce and use gdb_file_up
- Authentication-results: sourceware.org; auth=none
- References: <20170725172107.9799-1-tom@tromey.com> <20170725172107.9799-3-tom@tromey.com>
Hi Tom,
On 2017-07-25 19:20, Tom Tromey wrote:
diff --git a/gdb/common/filestuff.h b/gdb/common/filestuff.h
index b0a811b..3cf2df6 100644
--- a/gdb/common/filestuff.h
+++ b/gdb/common/filestuff.h
@@ -46,10 +46,23 @@ extern void close_most_fds (void);
extern int gdb_open_cloexec (const char *filename, int flags,
/* mode_t */ unsigned long mode);
+struct gdb_file_deleter
+{
+ void operator() (FILE *file) const
+ {
+ fclose (file);
+ }
+};
The name could lead people to think that this deletes/unlinks files,
don't you think?
But other than that, LGTM.
Thanks,
Simon