@@ -496,7 +496,11 @@ void do_system_shutdown(shutdown_type_t shutdown_type)
496496
497497 sub_buf.append (" Issuing shutdown via kernel...\n " );
498498 loop.poll (); // give message a chance to get to console
499+ #ifdef __NetBSD__
500+ reboot (reboot_type, NULL );
501+ #else
499502 reboot (reboot_type);
503+ #endif
500504}
501505
502506// Watcher for subprocess output.
@@ -637,7 +641,11 @@ static loop_t::child_proc_watcher::proc_status_t run_process(const char * prog_a
637641static void unmount_disks (loop_t &loop, subproc_buffer &sub_buf)
638642{
639643 try {
644+ #ifdef __NetBSD__
645+ const char * unmount_args[] = { " /sbin/umount" , " -a" , nullptr };
646+ #else
640647 const char * unmount_args[] = { " /bin/umount" , " -a" , " -r" , nullptr };
648+ #endif
641649 run_process (unmount_args, loop, sub_buf);
642650 }
643651 catch (std::exception &e) {
@@ -650,7 +658,11 @@ static void unmount_disks(loop_t &loop, subproc_buffer &sub_buf)
650658static void swap_off (loop_t &loop, subproc_buffer &sub_buf)
651659{
652660 try {
661+ #ifdef __NetBSD__
662+ const char * swapoff_args[] = { " /sbin/swapctl" , " -U" , nullptr };
663+ #else
653664 const char * swapoff_args[] = { " /sbin/swapoff" , " -a" , nullptr };
665+ #endif
654666 run_process (swapoff_args, loop, sub_buf);
655667 }
656668 catch (std::exception &e) {
0 commit comments