summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhalex <halex@openbsd.org>2014-02-13 05:51:06 +0000
committerhalex <halex@openbsd.org>2014-02-13 05:51:06 +0000
commit3683b99e91f1c67b0fbdbe0aaae530ad889e0896 (patch)
tree672f2ab6a8718771d0216ea7f45f5dbe5db8e8bb
parentdrm/i915: prefer VBT modes for SVDO-LVDS over EDID (diff)
downloadwireguard-openbsd-3683b99e91f1c67b0fbdbe0aaae530ad889e0896.tar.xz
wireguard-openbsd-3683b99e91f1c67b0fbdbe0aaae530ad889e0896.zip
if an attached sd(4) is readonly, make sure it's noticable in the
dmesg, or write operations just fail with EACCES for no obvious reason ok krw@ tedu@
-rw-r--r--sys/scsi/sd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c
index da02600c0ea..2e93ed0b1a6 100644
--- a/sys/scsi/sd.c
+++ b/sys/scsi/sd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sd.c,v 1.251 2013/11/01 17:36:19 krw Exp $ */
+/* $OpenBSD: sd.c,v 1.252 2014/02/13 05:51:06 halex Exp $ */
/* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */
/*-
@@ -233,6 +233,9 @@ sdattach(struct device *parent, struct device *self, void *aux)
sortby = BUFQ_FIFO;
printf(", thin");
}
+ if (ISSET(sc_link->flags, SDEV_READONLY)) {
+ printf(", readonly");
+ }
printf("\n");
break;