ref: ca343094bf764e8efefcded6f2b38da5f28b7e17
parent: c6f3ae88a9954e01eeed1ec244af415040f54f88
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Wed Mar 28 14:11:09 EDT 2012
port/chan.c: fix locking issue
--- a/sys/src/9/port/chan.c
+++ b/sys/src/9/port/chan.c
@@ -1015,15 +1015,15 @@
* mh->mount->to == c, so start at mh->mount->next
*/
rlock(&mh->lock);
- f = mh->mount;
- for(f = (f? f->next: f); f; f = f->next)
- if((wq = ewalk(f->to, nil, names+nhave, ntry)) != nil)
+ if((f = mh->mount) != nil)
+ f = f->next;
+ for(; f != nil; f = f->next)
+ if((wq = ewalk(f->to, nil, names+nhave, ntry)) != nil){+ type = f->to->type;
+ dev = f->to->dev;
break;
+ }
runlock(&mh->lock);
- if(f != nil){- type = f->to->type;
- dev = f->to->dev;
- }
}
if(wq == nil){cclose(c);
@@ -1624,7 +1624,7 @@
goto Open;
default:
- panic("unknown namec access %d\n", amode);+ panic("unknown namec access %d", amode);}
/* place final element in genbuf for e.g. exec */
--
⑨