shithub: riscv

Download patch

ref: e15b523a6c9b60a56fdb8d2cecdd55a7157d1b6c
parent: 6baaf0a7735a875d5d5384362e535ce127996926
author: cinap_lenrek <[email protected]>
date: Mon Aug 6 23:48:56 EDT 2012

libmach: fix acid -k regression (was broken in r5eeb36d3ddd0)

--- a/sys/src/libmach/map.c
+++ b/sys/src/libmach/map.c
@@ -89,11 +89,13 @@
 	map = newmap(0, 4);
 	if (!map)
 		return 0;
-	if(kflag)
+	if(kflag) {
 		regs = "kregs";
-	else
+		mode = OREAD;
+	} else {
 		regs = "regs";
-	mode = ORDWR;
+		mode = ORDWR;
+	}
 	if (mach->regsize) {
 		sprint(buf, "/proc/%d/%s", pid, regs);
 		fd = open(buf, mode);