kernel: dont pprint() into 9p channels

when fd 2 (stderr) points to a mount channel, dont
cause protocol confusion by dumping error strings
into it.
This commit is contained in:
cinap_lenrek 2016-07-19 22:10:52 +02:00
parent 95524b1cdd
commit 093eaec219

View file

@ -302,7 +302,7 @@ pprint(char *fmt, ...)
return 0;
c = up->fgrp->fd[2];
if(c==nil || (c->mode!=OWRITE && c->mode!=ORDWR))
if(c==nil || (c->flag&CMSG)!=0 || (c->mode!=OWRITE && c->mode!=ORDWR))
return 0;
n = snprint(buf, sizeof buf, "%s %lud: ", up->text, up->pid);
va_start(arg, fmt);