From 28e045cb621c105f983b8bbed66988a985dd6057 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Sat, 18 Feb 1995 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1995-02-18 --- pc/devfloppy.c | 10 +++++++--- port/pgrp.c | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pc/devfloppy.c b/pc/devfloppy.c index 2778773ab2752f2138486a9fdd07b7423cccd2a6..add118080dc4b6497335777b9505632878125f22 100644 --- a/pc/devfloppy.c +++ b/pc/devfloppy.c @@ -232,12 +232,13 @@ setdef(Drive *dp) { Type *t; - for(t = floppytype; t < &floppytype[NTYPES]; t++) + for(t = floppytype; t < &floppytype[NTYPES]; t++){ if(dp->dt == t->dt){ dp->t = t; floppydir[NFDIR*dp->dev].length = dp->t->cap; - break; + return; } + } } void @@ -1043,12 +1044,15 @@ floppyformat(Drive *dp, char *params) * set the type */ if(getfields(params, f, 3, " ") > 1){ - for(t = floppytype; t < &floppytype[NTYPES]; t++) + for(t = floppytype; t < &floppytype[NTYPES]; t++){ if(strcmp(f[1], t->name)==0 && t->dt==dp->dt){ dp->t = t; floppydir[NFDIR*dp->dev].length = dp->t->cap; break; } + } + if(t >= &floppytype[NTYPES]) + error(Ebadarg); } else { setdef(dp); t = dp->t; diff --git a/port/pgrp.c b/port/pgrp.c index 0b5fb880610d85d21ec8fdcc686fd58c2d03c0dc..dddb2bb38585c9aecad890b09106a6667f260d66 100644 --- a/port/pgrp.c +++ b/port/pgrp.c @@ -24,7 +24,7 @@ pgrpnote(ulong noteid, char *a, long n, int flag) for(; p < ep; p++) { if(p->state == Dead) continue; - if(p->noteid == noteid && p->kp == 0) { + if(up != p && p->noteid == noteid && p->kp == 0) { qlock(&p->debug); if(p->pid == 0 || p->noteid != noteid){ qunlock(&p->debug);