(void) write(STDERR_FILENO, rbuf, cp - rbuf);
(void) atomicio(write, STDERR_FILENO, rbuf, cp - rbuf);
response(){	char ch, *cp, resp, rbuf[2048];	if (read(remin, &resp, sizeof(resp)) != sizeof(resp))		lostconn(0);	cp = rbuf;	switch (resp) {	case 0:		/* ok */		return (0);	default:		*cp++ = resp;		/* FALLTHROUGH */	case 1:		/* error, followed by error msg */	case 2:		/* fatal error, "" */		do {			if (read(remin, &ch, sizeof(ch)) != sizeof(ch))				lostconn(0);			*cp++ = ch;		} while (cp < &rbuf[sizeof(rbuf) - 1] && ch != '\n');		if (!iamremote)			(void) write(STDERR_FILENO, rbuf, cp - rbuf);		++errs;		if (resp == 1)			return (-1);		exit(1);	}	/* NOTREACHED */}