This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA v2 02/24] Introduce and use gdb_file_up


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]