diff --git a/configure b/configure index 21264d1e..42595c37 100755 --- a/configure +++ b/configure @@ -420,10 +420,12 @@ fi [ -z "${STRIPOPTS+IS_SET}" ] && STRIPOPTS="-s" ## Verify PLATFORM value -if [ "$PLATFORM" != "Linux" ] && [ "$PLATFORM" != "FreeBSD" ] && \ -[ "$PLATFORM" != "OpenBSD" ] && [ "$PLATFORM" != "Darwin" ]; then - warning "$PLATFORM platform is unknown!" "Known Platforms are: Linux, FreeBSD, OpenBSD, Darwin" -fi +case "$PLATFORM" in + Linux|FreeBSD|NetBSD|OpenBSD|Darwin) ;; + *) warning "$PLATFORM platform is unknown!" \ + "Known Platforms are: Linux, FreeBSD, NetBSD, OpenBSD, Darwin" + ;; +esac ## Create testfile.cc to test c++ compiler configtmpdir=`mktmpdir` diff --git a/src/shutdown.cc b/src/shutdown.cc index 2e4ea915..6a6ab0ce 100644 --- a/src/shutdown.cc +++ b/src/shutdown.cc @@ -496,7 +496,11 @@ void do_system_shutdown(shutdown_type_t shutdown_type) sub_buf.append("Issuing shutdown via kernel...\n"); loop.poll(); // give message a chance to get to console +#ifdef __NetBSD__ + reboot(reboot_type, NULL); +#else reboot(reboot_type); +#endif } // Watcher for subprocess output. @@ -637,7 +641,11 @@ static loop_t::child_proc_watcher::proc_status_t run_process(const char * prog_a static void unmount_disks(loop_t &loop, subproc_buffer &sub_buf) { try { +#ifdef __NetBSD__ + const char * unmount_args[] = { "/sbin/umount", "-a", nullptr }; +#else const char * unmount_args[] = { "/bin/umount", "-a", "-r", nullptr }; +#endif run_process(unmount_args, loop, sub_buf); } catch (std::exception &e) { @@ -650,7 +658,11 @@ static void unmount_disks(loop_t &loop, subproc_buffer &sub_buf) static void swap_off(loop_t &loop, subproc_buffer &sub_buf) { try { +#ifdef __NetBSD__ + const char * swapoff_args[] = { "/sbin/swapctl", "-U", nullptr }; +#else const char * swapoff_args[] = { "/sbin/swapoff", "-a", nullptr }; +#endif run_process(swapoff_args, loop, sub_buf); } catch (std::exception &e) {