summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2010-12-31 22:58:40 +0000
committerkettenis <kettenis@openbsd.org>2010-12-31 22:58:40 +0000
commit14cbac953f5251465a8983cd3b68dd5242f84d77 (patch)
tree38a617f0af04b94dda12400a6dc888c8410eca58
parentmake randomattach do the parts of it's job in the right order, then move (diff)
downloadwireguard-openbsd-14cbac953f5251465a8983cd3b68dd5242f84d77.tar.xz
wireguard-openbsd-14cbac953f5251465a8983cd3b68dd5242f84d77.zip
Reintroduce the code that puts the drive into standby in shutdown, but
only do this if we're going to power down the machine. "My god, it is a 3 line diff. Commit it before it gets bigger!" deraadt@
-rw-r--r--sys/dev/ata/wd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/ata/wd.c b/sys/dev/ata/wd.c
index 1251a8370e5..ae526354813 100644
--- a/sys/dev/ata/wd.c
+++ b/sys/dev/ata/wd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wd.c,v 1.96 2010/12/30 20:29:13 kettenis Exp $ */
+/* $OpenBSD: wd.c,v 1.97 2010/12/31 22:58:40 kettenis Exp $ */
/* $NetBSD: wd.c,v 1.193 1999/02/28 17:15:27 explorer Exp $ */
/*
@@ -76,6 +76,7 @@
#include <sys/proc.h>
#include <sys/vnode.h>
#include <sys/dkio.h>
+#include <sys/reboot.h>
#include <uvm/uvm_extern.h>
@@ -1240,4 +1241,6 @@ wd_shutdown(void *arg)
struct wd_softc *wd = arg;
wd_flushcache(wd, AT_POLL);
+ if (boothowto & RB_POWERDOWN)
+ wd_standby(wd, AT_POLL);
}