stb.st_size, last);
(long long)stb.st_size, last);
source(argc, argv)	int argc;	char *argv[];{	struct stat stb;	static BUF buffer;	BUF *bp;	off_t i;	int amt, fd, haderr, indx, result;	char *last, *name, buf[2048];	for (indx = 0; indx < argc; ++indx) {		name = argv[indx];		statbytes = 0;		if ((fd = open(name, O_RDONLY, 0)) < 0)			goto syserr;		if (fstat(fd, &stb) < 0) {syserr:			run_err("%s: %s", name, strerror(errno));			goto next;		}		switch (stb.st_mode & S_IFMT) {		case S_IFREG:			break;		case S_IFDIR:			if (iamrecursive) {				rsource(name, &stb);				goto next;			}			/* FALLTHROUGH */		default:			run_err("%s: not a regular file", name);			goto next;		}		if ((last = strrchr(name, '/')) == NULL)			last = name;		else			++last;		curfile = last;		if (pflag) {			/*			 * Make it compatible with possible future			 * versions expecting microseconds.			 */			(void) snprintf(buf, sizeof buf, "T%lu 0 %lu 0\n",			    (u_long) stb.st_mtime,			    (u_long) stb.st_atime);			(void) atomicio(write, remout, buf, strlen(buf));			if (response() < 0)				goto next;		}#define	FILEMODEMASK	(S_ISUID|S_ISGID|S_IRWXU|S_IRWXG|S_IRWXO)		snprintf(buf, sizeof buf, "C%04o %lld %s\n",		    (u_int) (stb.st_mode & FILEMODEMASK),		    stb.st_size, last);		if (verbose_mode) {			fprintf(stderr, "Sending file modes: %s", buf);			fflush(stderr);		}		(void) atomicio(write, remout, buf, strlen(buf));		if (response() < 0)			goto next;		if ((bp = allocbuf(&buffer, fd, 2048)) == NULL) {next:			(void) close(fd);			continue;		}		if (showprogress) {			totalbytes = stb.st_size;			progressmeter(-1);		}		/* Keep writing after an error so that we stay sync'd up. */		for (haderr = i = 0; i < stb.st_size; i += bp->cnt) {			amt = bp->cnt;			if (i + amt > stb.st_size)				amt = stb.st_size - i;			if (!haderr) {				result = atomicio(read, fd, bp->buf, amt);				if (result != amt)					haderr = result >= 0 ? EIO : errno;			}			if (haderr)				(void) atomicio(write, remout, bp->buf, amt);			else {				result = atomicio(write, remout, bp->buf, amt);				if (result != amt)					haderr = result >= 0 ? EIO : errno;				statbytes += result;			}		}		if (showprogress)			progressmeter(1);		if (close(fd) < 0 && !haderr)			haderr = errno;		if (!haderr)			(void) atomicio(write, remout, "", 1);		else			run_err("%s: %s", name, strerror(haderr));		(void) response();	}}