This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2 1/7] common: add scoped_fd
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: Markus Metzger <markus dot t dot metzger at intel dot com>
- Cc: GDB Patches <gdb-patches at sourceware dot org>
- Date: Tue, 13 Feb 2018 16:48:19 +0000
- Subject: Re: [PATCH v2 1/7] common: add scoped_fd
- Authentication-results: sourceware.org; auth=none
- References: <1516976072-19282-1-git-send-email-markus.t.metzger@intel.com> <1516976072-19282-2-git-send-email-markus.t.metzger@intel.com>
On Fri, Jan 26, 2018 at 2:14 PM, Markus Metzger
<markus.t.metzger@intel.com> wrote:
> +
> +/* Test that the file descriptor is closed. */
> +static void
> +test_destroy ()
> +{
> + char filename[] = "scoped_fd-selftest-XXXXXX";
> + int fd = mkstemp (filename);
> + SELF_CHECK (fd >= 0);
Hi Markus,
I failed to build this file with i686-w64-mingw32-g++ 4.8.2, shipped
in Ubuntu 14.04.
gdb/unittests/scoped_fd-selftests.c:37:29: error: ‘mkstemp’ was not
declared in this scope
int fd = mkstemp (filename);
^
gdb/unittests/scoped_fd-selftests.c: In function ‘void
selftests::scoped_fd::test_release()’:
gdb/unittests/scoped_fd-selftests.c:56:29: error: ‘mkstemp’ was not
declared in this scope
int fd = mkstemp (filename);
^
There is no such error with i686-w64-mingw32-g++ 5.3.1. Can we use
"open" instead?
--
Yao (齐尧)