common: add scoped_fd
authorMarkus Metzger <markus.t.metzger@intel.com>
Fri, 26 Jan 2018 12:07:29 +0000 (13:07 +0100)
committerMarkus Metzger <markus.t.metzger@intel.com>
Fri, 9 Feb 2018 13:03:18 +0000 (14:03 +0100)
commitea4a0888120dec61348cae460ffa08de663e2852
tree10e0954504a3fa4e99dce1a4af3766515a4126dd
parent869e8290ea62f594d2472476303bb74604e9326b
common: add scoped_fd

Add a simple helper to automatically close a file descriptor.

gdb/
* common/scoped_fd.h: New.
* unittests/scoped_fd-selftest.c: New.
* Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
unittests/scoped_fd-selftest.c.
gdb/ChangeLog
gdb/Makefile.in
gdb/common/scoped_fd.h [new file with mode: 0644]
gdb/unittests/scoped_fd-selftests.c [new file with mode: 0644]