shithub: riscv

Download patch

ref: 8173223f439546685f0cc4471efc9a9d12fccf4c
parent: a0d4c5e208405f84076891faaa43235bb2b87fc2
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Jul 23 23:23:01 EDT 2016

swap: make sure swap chan has ORDWR mode on fdtochan()

--- a/sys/src/9/port/devcons.c
+++ b/sys/src/9/port/devcons.c
@@ -795,7 +795,7 @@
 		if(buf[0]<'0' || '9'<buf[0])
 			error(Ebadarg);
 		fd = strtoul(buf, 0, 0);
-		swc = fdtochan(fd, -1, 1, 1);
+		swc = fdtochan(fd, ORDWR, 1, 1);
 		setswapchan(swc);
 		break;