Module Name:    src
Committed By:   jmmv
Date:           Tue Feb 11 17:28:21 UTC 2014

Modified Files:
        src/external/bsd/atf/dist/tools: application.cpp atf-run.cpp
            atf-version.cpp env.cpp fs.cpp signals.cpp timers.cpp
        src/external/bsd/atf/lib/tools: Makefile
        src/external/bsd/atf/usr.bin/atf-config: Makefile
        src/external/bsd/atf/usr.bin/atf-report: Makefile
        src/external/bsd/atf/usr.bin/atf-run: Makefile
        src/external/bsd/atf/usr.bin/atf-version: Makefile

Log Message:
Stop using bconfig.h in the tools code.

Just assume the code is being built for NetBSD for simplicity reasons.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/atf/dist/tools/application.cpp \
    src/external/bsd/atf/dist/tools/timers.cpp
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/atf/dist/tools/atf-run.cpp \
    src/external/bsd/atf/dist/tools/atf-version.cpp
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/atf/dist/tools/env.cpp \
    src/external/bsd/atf/dist/tools/fs.cpp \
    src/external/bsd/atf/dist/tools/signals.cpp
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/atf/lib/tools/Makefile
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/atf/usr.bin/atf-config/Makefile
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/atf/usr.bin/atf-report/Makefile
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/atf/usr.bin/atf-run/Makefile
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/atf/usr.bin/atf-version/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/tools/application.cpp
diff -u src/external/bsd/atf/dist/tools/application.cpp:1.2 src/external/bsd/atf/dist/tools/application.cpp:1.3
--- src/external/bsd/atf/dist/tools/application.cpp:1.2	Tue Feb 11 16:31:38 2014
+++ src/external/bsd/atf/dist/tools/application.cpp	Tue Feb 11 17:28:20 2014
@@ -27,10 +27,6 @@
 // IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 //
 
-#if defined(HAVE_CONFIG_H)
-#include "bconfig.h"
-#endif
-
 extern "C" {
 #include <unistd.h>
 }
@@ -45,11 +41,9 @@ extern "C" {
 #include "application.hpp"
 #include "ui.hpp"
 
-#if !defined(HAVE_VSNPRINTF_IN_STD)
 namespace std {
 using ::vsnprintf;
 }
-#endif // !defined(HAVE_VSNPRINTF_IN_STD)
 
 namespace impl = tools::application;
 #define IMPL_NAME "tools::application"
@@ -157,11 +151,7 @@ impl::app::process_options(void)
 {
     assert(inited());
 
-    std::string optstr;
-#if defined(HAVE_GNU_GETOPT)
-    optstr += '+'; // Turn on POSIX behavior.
-#endif
-    optstr += ':';
+    std::string optstr = ":";
     {
         options_set opts = options();
         for (options_set::const_iterator iter = opts.begin();
@@ -200,9 +190,7 @@ impl::app::process_options(void)
     // Clear getopt state just in case the test wants to use it.
     opterr = old_opterr;
     optind = 1;
-#if defined(HAVE_OPTRESET)
     optreset = 1;
-#endif
 }
 
 void
@@ -275,9 +263,8 @@ impl::app::run(int argc, char* const* ar
 
     const std::string bug =
         std::string("This is probably a bug in ") + m_prog_name +
-        " or one of the libraries it uses.  Please report this problem to "
-        PACKAGE_BUGREPORT " and provide as many details as possible "
-        "describing how you got to this condition.";
+        " Please use send-pr(1) to report this issue and provide as many"
+	" details as possible describing how you got to this condition.";
 
     int errcode;
     try {
Index: src/external/bsd/atf/dist/tools/timers.cpp
diff -u src/external/bsd/atf/dist/tools/timers.cpp:1.2 src/external/bsd/atf/dist/tools/timers.cpp:1.3
--- src/external/bsd/atf/dist/tools/timers.cpp:1.2	Tue Feb 11 16:31:38 2014
+++ src/external/bsd/atf/dist/tools/timers.cpp	Tue Feb 11 17:28:20 2014
@@ -27,10 +27,6 @@
 // IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 //
 
-#if defined(HAVE_CONFIG_H)
-#   include <bconfig.h>
-#endif
-
 extern "C" {
 #include <sys/time.h>
 }
@@ -47,15 +43,10 @@ extern "C" {
 namespace impl = tools::timers;
 #define IMPL_NAME "tools::timers"
 
-#if !defined(HAVE_TIMER_T)
-static impl::timer* compat_handle;
-#endif
-
 // ------------------------------------------------------------------------
 // Auxiliary functions.
 // ------------------------------------------------------------------------
 
-#if defined(HAVE_TIMER_T)
 static
 void
 handler(const int signo __attribute__((__unused__)), siginfo_t* si,
@@ -65,29 +56,14 @@ handler(const int signo __attribute__((_
     timer->set_fired();
     timer->timeout_callback();
 }
-#else
-static
-void
-handler(const int signo __attribute__((__unused__)),
-        siginfo_t* si __attribute__((__unused__)),
-        void* uc __attribute__((__unused__)))
-{
-    compat_handle->set_fired();
-    compat_handle->timeout_callback();
-}
-#endif
 
 // ------------------------------------------------------------------------
 // The "timer" class.
 // ------------------------------------------------------------------------
 
 struct impl::timer::impl {
-#if defined(HAVE_TIMER_T)
     ::timer_t m_timer;
     ::itimerspec m_old_it;
-#else
-    ::itimerval m_old_it;
-#endif
 
     struct ::sigaction m_old_sa;
     volatile bool m_fired;
@@ -108,7 +84,6 @@ impl::timer::timer(const unsigned int se
         throw tools::system_error(IMPL_NAME "::timer::timer",
                                 "Failed to set signal handler", errno);
 
-#if defined(HAVE_TIMER_T)
     struct ::sigevent se;
     se.sigev_notify = SIGEV_SIGNAL;
     se.sigev_signo = SIGALRM;
@@ -132,41 +107,17 @@ impl::timer::timer(const unsigned int se
         throw tools::system_error(IMPL_NAME "::timer::timer",
                                 "Failed to program timer", errno);
     }
-#else
-    ::itimerval it;
-    it.it_interval.tv_sec = 0;
-    it.it_interval.tv_usec = 0;
-    it.it_value.tv_sec = seconds;
-    it.it_value.tv_usec = 0;
-    if (::setitimer(ITIMER_REAL, &it, &m_pimpl->m_old_it) == -1) {
-        ::sigaction(SIGALRM, &m_pimpl->m_old_sa, NULL);
-        throw tools::system_error(IMPL_NAME "::timer::timer",
-                                "Failed to program timer", errno);
-    }
-    assert(compat_handle == NULL);
-    compat_handle = this;
-#endif
 }
 
 impl::timer::~timer(void)
 {
-#if defined(HAVE_TIMER_T)
-    {
-        const int ret = ::timer_delete(m_pimpl->m_timer);
-        assert(ret != -1);
-    }
-#else
-    {
-        const int ret = ::setitimer(ITIMER_REAL, &m_pimpl->m_old_it, NULL);
-        assert(ret != -1);
-    }
-#endif
-    const int ret = ::sigaction(SIGALRM, &m_pimpl->m_old_sa, NULL);
+    int ret;
+
+    ret = ::timer_delete(m_pimpl->m_timer);
     assert(ret != -1);
 
-#if !defined(HAVE_TIMER_T)
-    compat_handle = NULL;
-#endif
+    ret = ::sigaction(SIGALRM, &m_pimpl->m_old_sa, NULL);
+    assert(ret != -1);
 }
 
 bool

Index: src/external/bsd/atf/dist/tools/atf-run.cpp
diff -u src/external/bsd/atf/dist/tools/atf-run.cpp:1.3 src/external/bsd/atf/dist/tools/atf-run.cpp:1.4
--- src/external/bsd/atf/dist/tools/atf-run.cpp:1.3	Sat Feb  8 19:13:44 2014
+++ src/external/bsd/atf/dist/tools/atf-run.cpp	Tue Feb 11 17:28:20 2014
@@ -27,10 +27,6 @@
 // IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 //
 
-#if defined(HAVE_CONFIG_H)
-#include "bconfig.h"
-#endif
-
 extern "C" {
 #include <sys/types.h>
 #include <sys/param.h>
Index: src/external/bsd/atf/dist/tools/atf-version.cpp
diff -u src/external/bsd/atf/dist/tools/atf-version.cpp:1.3 src/external/bsd/atf/dist/tools/atf-version.cpp:1.4
--- src/external/bsd/atf/dist/tools/atf-version.cpp:1.3	Sat Feb  8 19:13:44 2014
+++ src/external/bsd/atf/dist/tools/atf-version.cpp	Tue Feb 11 17:28:20 2014
@@ -27,10 +27,6 @@
 // IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 //
 
-#if defined(HAVE_CONFIG_H)
-#include "bconfig.h"
-#endif
-
 #include <cstdlib>
 #include <iostream>
 
@@ -62,8 +58,9 @@ atf_version::main(void)
     using tools::ui::format_text;
     using tools::ui::format_text_with_tag;
 
-    std::cout << PACKAGE_STRING " (" PACKAGE_TARNAME "-" PACKAGE_VERSION
-                 ")\n" PACKAGE_COPYRIGHT "\n\n";
+    std::cout <<
+        "Automated Testing Framework " ATF_VERSION " (atf-" ATF_VERSION ")\n"
+        "Copyright (c) 2007 The NetBSD Foundation, Inc.\n\n";
 
 #if defined(PACKAGE_REVISION_TYPE_DIST)
     std::cout << format_text("Built from a distribution file; no revision "

Index: src/external/bsd/atf/dist/tools/env.cpp
diff -u src/external/bsd/atf/dist/tools/env.cpp:1.1.1.1 src/external/bsd/atf/dist/tools/env.cpp:1.2
--- src/external/bsd/atf/dist/tools/env.cpp:1.1.1.1	Sat Feb  8 19:11:33 2014
+++ src/external/bsd/atf/dist/tools/env.cpp	Tue Feb 11 17:28:20 2014
@@ -27,10 +27,6 @@
 // IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 //
 
-#if defined(HAVE_CONFIG_H)
-#include "bconfig.h"
-#endif
-
 extern "C" {
 #include <errno.h>
 #include <stdlib.h>
@@ -66,37 +62,15 @@ impl::has(const std::string& name)
 void
 impl::set(const std::string& name, const std::string& val)
 {
-#if defined(HAVE_SETENV)
     if (setenv(name.c_str(), val.c_str(), 1) == -1)
         throw tools::system_error(IMPL_NAME "::set",
                                 "Cannot set environment variable '" + name +
                                 "' to '" + val + "'",
                                 errno);
-#elif defined(HAVE_PUTENV)
-    const std::string buf = name + "=" + val;
-    if (putenv(strdup(buf.c_str())) == -1)
-        throw tools::system_error(IMPL_NAME "::set",
-                                "Cannot set environment variable '" + name +
-                                "' to '" + val + "'",
-                                errno);
-#else
-#   error "Don't know how to set an environment variable."
-#endif
 }
 
 void
 impl::unset(const std::string& name)
 {
-#if defined(HAVE_UNSETENV)
     unsetenv(name.c_str());
-#elif defined(HAVE_PUTENV)
-    const std::string buf = name + "=";
-
-    if (putenv(strdup(buf.c_str())) == -1)
-        throw tools::system_error(IMPL_NAME "::unset",
-                                "Cannot unset environment variable '" +
-                                name + "'", errno);
-#else
-#   error "Don't know how to unset an environment variable."
-#endif
 }
Index: src/external/bsd/atf/dist/tools/fs.cpp
diff -u src/external/bsd/atf/dist/tools/fs.cpp:1.1.1.1 src/external/bsd/atf/dist/tools/fs.cpp:1.2
--- src/external/bsd/atf/dist/tools/fs.cpp:1.1.1.1	Sat Feb  8 19:11:33 2014
+++ src/external/bsd/atf/dist/tools/fs.cpp	Tue Feb 11 17:28:20 2014
@@ -27,10 +27,6 @@
 // IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 //
 
-#if defined(HAVE_CONFIG_H)
-#include "bconfig.h"
-#endif
-
 extern "C" {
 #include <sys/param.h>
 #include <sys/types.h>
@@ -52,7 +48,6 @@ extern "C" {
 #include "env.hpp"
 #include "exceptions.hpp"
 #include "fs.hpp"
-#include "process.hpp"
 #include "text.hpp"
 #include "user.hpp"
 
@@ -257,7 +252,6 @@ do_unmount(const impl::path& in_path)
     const impl::path& abs_path = in_path.is_absolute() ?
         in_path : in_path.to_absolute();
 
-#if defined(HAVE_UNMOUNT)
     int retries = max_retries;
 retry_unmount:
     if (unmount(abs_path.c_str(), 0) == -1) {
@@ -270,21 +264,6 @@ retry_unmount:
                                     ")", "unmount(2) failed", errno);
         }
     }
-#else
-    // We could use umount(2) instead if it was available... but
-    // trying to do so under, e.g. Linux, is a nightmare because we
-    // also have to update /etc/mtab to match what we did.  It is
-    // stools::fser to just leave the system-specific umount(8) tool deal
-    // with it, at least for now.
-
-    const impl::path prog("umount");
-    tools::process::argv_array argv("umount", abs_path.c_str(), NULL);
-
-    tools::process::status s = tools::process::exec(prog, argv,
-        tools::process::stream_inherit(), tools::process::stream_inherit());
-    if (!s.exited() || s.exitstatus() != EXIT_SUCCESS)
-        throw std::runtime_error("Call to unmount failed");
-#endif
 }
 
 static
@@ -731,11 +710,7 @@ impl::path
 impl::get_current_dir(void)
 {
     std::auto_ptr< char > cwd;
-#if defined(HAVE_GETCWD_DYN)
     cwd.reset(getcwd(NULL, 0));
-#else
-    cwd.reset(getcwd(NULL, MAXPATHLEN));
-#endif
     if (cwd.get() == NULL)
         throw tools::system_error(IMPL_NAME "::get_current_dir()",
                                 "getcwd() failed", errno);
Index: src/external/bsd/atf/dist/tools/signals.cpp
diff -u src/external/bsd/atf/dist/tools/signals.cpp:1.1.1.1 src/external/bsd/atf/dist/tools/signals.cpp:1.2
--- src/external/bsd/atf/dist/tools/signals.cpp:1.1.1.1	Sat Feb  8 19:11:33 2014
+++ src/external/bsd/atf/dist/tools/signals.cpp	Tue Feb 11 17:28:20 2014
@@ -27,10 +27,6 @@
 // IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 //
 
-#if defined(HAVE_CONFIG_H)
-#include "bconfig.h"
-#endif
-
 extern "C" {
 #include <signal.h>
 #include <unistd.h>
@@ -45,6 +41,7 @@ extern "C" {
 namespace impl = tools::signals;
 #define IMPL_NAME "tools::signals"
 
+#define LAST_SIGNO 63
 const int impl::last_signo = LAST_SIGNO;
 
 // ------------------------------------------------------------------------

Index: src/external/bsd/atf/lib/tools/Makefile
diff -u src/external/bsd/atf/lib/tools/Makefile:1.3 src/external/bsd/atf/lib/tools/Makefile:1.4
--- src/external/bsd/atf/lib/tools/Makefile:1.3	Tue Feb 11 16:31:38 2014
+++ src/external/bsd/atf/lib/tools/Makefile	Tue Feb 11 17:28:21 2014
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2014/02/11 16:31:38 jmmv Exp $
+# $NetBSD: Makefile,v 1.4 2014/02/11 17:28:21 jmmv Exp $
 
 NOLINT=		# defined
 
@@ -13,7 +13,6 @@ LIBDPLIBS+=     m	${.CURDIR}/../../../..
 .PATH:		${SRCDIR}
 .PATH:		${SRCDIR}/tools
 
-CPPFLAGS+=	-DHAVE_CONFIG_H
 CPPFLAGS+=	-DATF_ARCH=\"${MACHINE_ARCH}\"
 CPPFLAGS+=	-DATF_BUILD_CC=\"/usr/bin/cc\"
 CPPFLAGS+=	-DATF_BUILD_CFLAGS=\"\"
@@ -29,10 +28,8 @@ CPPFLAGS+=	-DATF_MACHINE=\"${MACHINE}\"
 CPPFLAGS+=	-DATF_PKGDATADIR=\"/usr/share/atf\"
 CPPFLAGS+=	-DATF_SHELL=\"/bin/sh\"
 CPPFLAGS+=	-DATF_WORKDIR=\"/tmp\"
-CPPFLAGS+=	-DLAST_SIGNO=63
 CPPFLAGS+=	-I${SRCDIR}/tools
 CPPFLAGS+=	-I.
-CPPFLAGS+=	-I${TOPDIR}/lib/libatf-c  # For bconfig.h
 
 WARNS?=		2
 

Index: src/external/bsd/atf/usr.bin/atf-config/Makefile
diff -u src/external/bsd/atf/usr.bin/atf-config/Makefile:1.6 src/external/bsd/atf/usr.bin/atf-config/Makefile:1.7
--- src/external/bsd/atf/usr.bin/atf-config/Makefile:1.6	Sat Feb  8 19:15:34 2014
+++ src/external/bsd/atf/usr.bin/atf-config/Makefile	Tue Feb 11 17:28:21 2014
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.6 2014/02/08 19:15:34 jmmv Exp $
+# $NetBSD: Makefile,v 1.7 2014/02/11 17:28:21 jmmv Exp $
 
 .include <bsd.own.mk>
 
@@ -12,7 +12,6 @@ MAN=		atf-config.1
 
 USE_ATF_LIBTOOLS=	yes
 
-CPPFLAGS+=	-DHAVE_CONFIG_H
 CPPFLAGS+=	-I${SRCDIR}/tools
 
 WARNS?=		2

Index: src/external/bsd/atf/usr.bin/atf-report/Makefile
diff -u src/external/bsd/atf/usr.bin/atf-report/Makefile:1.7 src/external/bsd/atf/usr.bin/atf-report/Makefile:1.8
--- src/external/bsd/atf/usr.bin/atf-report/Makefile:1.7	Sat Feb  8 19:15:34 2014
+++ src/external/bsd/atf/usr.bin/atf-report/Makefile	Tue Feb 11 17:28:21 2014
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.7 2014/02/08 19:15:34 jmmv Exp $
+# $NetBSD: Makefile,v 1.8 2014/02/11 17:28:21 jmmv Exp $
 
 .include <bsd.own.mk>
 
@@ -12,7 +12,6 @@ MAN=		atf-report.1
 
 USE_ATF_LIBTOOLS=	yes
 
-CPPFLAGS+=	-DHAVE_CONFIG_H
 CPPFLAGS+=	-I${SRCDIR}/tools
 
 WARNS?=		2

Index: src/external/bsd/atf/usr.bin/atf-run/Makefile
diff -u src/external/bsd/atf/usr.bin/atf-run/Makefile:1.12 src/external/bsd/atf/usr.bin/atf-run/Makefile:1.13
--- src/external/bsd/atf/usr.bin/atf-run/Makefile:1.12	Sat Feb  8 19:15:34 2014
+++ src/external/bsd/atf/usr.bin/atf-run/Makefile	Tue Feb 11 17:28:21 2014
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.12 2014/02/08 19:15:34 jmmv Exp $
+# $NetBSD: Makefile,v 1.13 2014/02/11 17:28:21 jmmv Exp $
 
 .include <bsd.own.mk>
 
@@ -12,9 +12,7 @@ SRCS=		atf-run.cpp
 MAN=		atf-run.1
 
 CPPFLAGS+=	-DGDB=\"/usr/bin/gdb\"
-CPPFLAGS+=	-DHAVE_CONFIG_H
 CPPFLAGS+=	-I${SRCDIR}/tools
-CPPFLAGS+=	-I${SRCDIR:H}/lib/libatf-c  # For bconfig.h.
 
 USE_ATF_LIBTOOLS=	yes
 

Index: src/external/bsd/atf/usr.bin/atf-version/Makefile
diff -u src/external/bsd/atf/usr.bin/atf-version/Makefile:1.8 src/external/bsd/atf/usr.bin/atf-version/Makefile:1.9
--- src/external/bsd/atf/usr.bin/atf-version/Makefile:1.8	Sat Feb  8 19:15:34 2014
+++ src/external/bsd/atf/usr.bin/atf-version/Makefile	Tue Feb 11 17:28:21 2014
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.8 2014/02/08 19:15:34 jmmv Exp $
+# $NetBSD: Makefile,v 1.9 2014/02/11 17:28:21 jmmv Exp $
 
 .include <bsd.own.mk>
 
@@ -10,9 +10,8 @@ PROG_CXX=	atf-version
 SRCS=		atf-version.cpp
 MAN=		atf-version.1
 
-CPPFLAGS+=	-DHAVE_CONFIG_H
+CPPFLAGS+=	-DATF_VERSION=\"$(ATF_VERSION)\"
 CPPFLAGS+=	-I${SRCDIR}/tools
-CPPFLAGS+=	-I${SRCDIR:H}/lib/libatf-c  # For bconfig.h.
 CPPFLAGS+=	-I${.CURDIR}
 
 USE_ATF_LIBTOOLS=	yes

Reply via email to