shithub: riscv

Download patch

ref: 9cb3e5900e916196cb13d460727a2d863627327a
parent: ab3492f05e5998f79befe6e7397175f4bdb39149
author: cinap_lenrek <[email protected]>
date: Wed Sep 28 15:15:10 EDT 2016

nusb/lib: fix wrong endpoint id when openep() finds already existing endpoint file

--- a/sys/src/cmd/nusb/lib/dev.c
+++ b/sys/src/cmd/nusb/lib/dev.c
@@ -54,8 +54,10 @@
 	if(access(name, AEXIST) == 0){
 		dprint(2, "%s: %s already exists; trying to open\n", argv0, name);
 		epd = opendev(name);
-		if(epd != nil)
+		if(epd != nil){
+			epd->id = id;
 			epd->maxpkt = ep->maxpkt;	/* guess */
+		}
 		return epd;
 	}
 	if(devctl(d, "new %d %d %s", id, ep->type, mode) < 0){