if (restart_point) mode = "r+";
store(name, mode, unique)	char *name, *mode;	int unique;{	FILE *fout, *din;	int (*closefunc) __P((FILE *));	struct stat st;	int fd;	if (unique && stat(name, &st) == 0) {		char *nam;		fd = guniquefd(name, &nam);		if (fd == -1) {			LOGCMD(*mode == 'w' ? "put" : "append", name);			return;		}		name = nam;		if (restart_point)			mode = "r+";		fout = fdopen(fd, mode);	} else		fout = fopen(name, mode);	closefunc = fclose;	if (fout == NULL) {		perror_reply(553, name);		LOGCMD(*mode == 'w' ? "put" : "append", name);		return;	}	byte_count = -1;	if (restart_point) {		if (type == TYPE_A) {			off_t i, n;			int c;			n = restart_point;			i = 0;			while (i++ < n) {				if ((c=getc(fout)) == EOF) {					perror_reply(550, name);					goto done;				}				if (c == '\n')					i++;			}			/*			 * We must do this seek to "current" position			 * because we are changing from reading to			 * writing.			 */			if (fseek(fout, 0L, SEEK_CUR) < 0) {				perror_reply(550, name);				goto done;			}		} else if (lseek(fileno(fout), restart_point, SEEK_SET) < 0) {			perror_reply(550, name);			goto done;		}	}	din = dataconn(name, (off_t)-1, "r");	if (din == NULL)		goto done;	if (receive_data(din, fout) == 0) {		if (unique)			reply(226, "Transfer complete (unique file name:%s).",			    name);		else			reply(226, "Transfer complete.");	}	(void) fclose(din);	data = -1;	pdata = -1;done:	LOGBYTES(*mode == 'w' ? "put" : "append", name, byte_count);	(*closefunc)(fout);}