ATF needs C++98 for now, and GCC 6.4 defaults to C++11. trunk
authormrg <mrg@NetBSD.org>
Sun, 04 Feb 2018 01:41:05 +0000
branchtrunk
changeset 274956 3ea87843f2bf
parent 274955 a1850bfedc8b
child 274957 24b437595f28
ATF needs C++98 for now, and GCC 6.4 defaults to C++11. fix a problem -Werror=misleading-indentation found but has zero effect on the running code.
external/bsd/atf/Makefile.inc
external/bsd/atf/dist/tools/process.cpp
--- a/external/bsd/atf/Makefile.inc	Sun Feb 04 01:17:40 2018 +0000
+++ b/external/bsd/atf/Makefile.inc	Sun Feb 04 01:41:05 2018 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.5 2014/02/15 04:19:46 jmmv Exp $
+# $NetBSD: Makefile.inc,v 1.6 2018/02/04 01:41:05 mrg Exp $
 
 .include <bsd.own.mk>
 
@@ -41,6 +41,8 @@
 CPPFLAGS+=	-I${TOPDIR}/lib/libatf-c	# For atf-c/defs.hpp.
 CPPFLAGS+=	-I${SRCDIR}
 
+CXXFLAGS+=	-std=gnu++98
+
 .if defined(USE_ATF_LIBTOOLS)
 LIBTOOLSOBJDIR!=	cd ${TOPDIR}/lib/tools; ${PRINTOBJDIR}
 CPPFLAGS+=		-I${LIBTOOLSOBJDIR}
--- a/external/bsd/atf/dist/tools/process.cpp	Sun Feb 04 01:17:40 2018 +0000
+++ b/external/bsd/atf/dist/tools/process.cpp	Sun Feb 04 01:41:05 2018 +0000
@@ -441,10 +441,12 @@
         ::kill(m_pid, SIGTERM);
         (void)wait();
 
-        if (m_stdout != -1)
-            ::close(m_stdout);
-        if (m_stderr != -1)
-            ::close(m_stderr);
+        if (m_stdout != -1) {
+            ::close(m_stdout); m_stdout = -1;
+        }
+        if (m_stderr != -1) {
+            ::close(m_stderr); m_stderr = -1;
+        }
     }
 }
 
@@ -457,10 +459,12 @@
         throw system_error(IMPL_NAME "::child::wait", "Failed waiting for "
                            "process " + text::to_string(m_pid), errno);
 
-    if (m_stdout != -1)
+    if (m_stdout != -1) {
         ::close(m_stdout); m_stdout = -1;
-    if (m_stderr != -1)
+    }
+    if (m_stderr != -1) {
         ::close(m_stderr); m_stderr = -1;
+    }
 
     m_waited = true;
     return status(s);