Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 447370 | Differences between
and this patch

Collapse All | Expand All

(-)a/bin/cp/cp.c (-2 / +3 lines)
Lines 386-392 copy(char *argv[], enum op type, int fts_options) Link Here
386
		}
386
		}
387
387
388
		/* Not an error but need to remember it happened */
388
		/* Not an error but need to remember it happened */
389
		if (stat(to.p_path, &to_stat) == -1)
389
		if ((!Rflag && stat(to.p_path, &to_stat) == -1) ||
390
		    (Rflag && lstat(to.p_path, &to_stat) == -1))
390
			dne = 1;
391
			dne = 1;
391
		else {
392
		else {
392
			if (to_stat.st_dev == curr->fts_statp->st_dev &&
393
			if (to_stat.st_dev == curr->fts_statp->st_dev &&
Lines 481-487 copy(char *argv[], enum op type, int fts_options) Link Here
481
				badcp = rval = 1;
482
				badcp = rval = 1;
482
			break;
483
			break;
483
		}
484
		}
484
		if (vflag && !badcp)
485
		if (vflag && !badcp && !nflag)
485
			(void)printf("%s -> %s\n", curr->fts_path, to.p_path);
486
			(void)printf("%s -> %s\n", curr->fts_path, to.p_path);
486
	}
487
	}
487
	if (errno)
488
	if (errno)
(-)a/bin/cp/utils.c (+5 lines)
Lines 266-271 copy_link(const FTSENT *p, int exists) Link Here
266
	int len;
266
	int len;
267
	char llink[PATH_MAX];
267
	char llink[PATH_MAX];
268
268
269
	if (exists && nflag) {
270
		if (vflag)
271
			printf("%s not overwritten\n", to.p_path);
272
		return (0);
273
	}
269
	if ((len = readlink(p->fts_path, llink, sizeof(llink) - 1)) == -1) {
274
	if ((len = readlink(p->fts_path, llink, sizeof(llink) - 1)) == -1) {
270
		warn("readlink: %s", p->fts_path);
275
		warn("readlink: %s", p->fts_path);
271
		return (1);
276
		return (1);

Return to bug 447370