if (cout == NULL) { warnx("Lost control connection for abort."); if (ptabflg) code = -1; lostpeer(); return; }
abort_remote(din)	FILE *din;{	char buf[BUFSIZ];	int nfnd;	struct fd_set mask;	/*	 * send IAC in urgent mode instead of DM because 4.3BSD places oob mark	 * after urgent byte rather than before as is protocol now	 */	sprintf(buf, "%c%c%c", IAC, IP, IAC);	if (send(fileno(cout), buf, 3, MSG_OOB) != 3)		warn("abort");	fprintf(cout, "%cABOR\r\n", DM);	(void)fflush(cout);	FD_ZERO(&mask);	FD_SET(fileno(cin), &mask);	if (din) {		FD_SET(fileno(din), &mask);	}	if ((nfnd = empty(&mask, 10)) <= 0) {		if (nfnd < 0) {			warn("abort");		}		if (ptabflg)			code = -1;		lostpeer();	}	if (din && FD_ISSET(fileno(din), &mask)) {		while (read(fileno(din), buf, BUFSIZ) > 0)			/* LOOP */;	}	if (getreply(0) == ERROR && code == 552) {		/* 552 needed for nic style abort */		(void)getreply(0);	}	(void)getreply(0);}