From owner-freebsd-bugs Wed Jun 12 22:30:14 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 4632637B40C for ; Wed, 12 Jun 2002 22:30:02 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g5D5U2401726; Wed, 12 Jun 2002 22:30:02 -0700 (PDT) (envelope-from gnats) Received: from chowder.gsoft.com.au (chowder.gsoft.com.au [203.38.152.100]) by hub.freebsd.org (Postfix) with ESMTP id 1A72337B411 for ; Wed, 12 Jun 2002 22:22:42 -0700 (PDT) Received: from chowder.gsoft.com.au (localhost [127.0.0.1]) by chowder.gsoft.com.au (8.12.3/8.12.3) with ESMTP id g5D5Mdm0000239 for ; Thu, 13 Jun 2002 14:52:39 +0930 (CST) (envelope-from darius@chowder.gsoft.com.au) Received: (from darius@localhost) by chowder.gsoft.com.au (8.12.3/8.12.3/Submit) id g5D4gNtp003682; Thu, 13 Jun 2002 14:12:23 +0930 (CST) Message-Id: <200206130442.g5D4gNtp003682@chowder.gsoft.com.au> Date: Thu, 13 Jun 2002 14:12:23 +0930 (CST) From: "Daniel O'Connor" Reply-To: "Daniel O'Connor" To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/39217: cp returns non-zero when copying a symlink to it's linkee. Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 39217 >Category: bin >Synopsis: cp returns non-zero when copying a symlink to it's linkee. >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jun 12 22:30:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Daniel O'Connor >Release: FreeBSD 4.6-PRERELEASE i386 >Organization: >Environment: System: FreeBSD chowder.gsoft.com.au 4.6-PRERELEASE FreeBSD 4.6-PRERELEASE #12: Fri May 10 15:54:54 CST 2002 darius@chowder.gsoft.com.au:/usr/obj/usr/src/sys/CHOWDER i386 >Description: When cp is requested to copy a file to a link of that file (hard or soft) it returns non-zero. This does seem a little contrary in my opinion. >How-To-Repeat: touch foo ln -s foo bar cp foo bar echo $? >Fix: --- cp.c.orig Thu Jun 13 14:11:27 2002 +++ cp.c Thu Jun 13 14:11:37 2002 @@ -368,7 +368,7 @@ to_stat.st_ino == curr->fts_statp->st_ino) { warnx("%s and %s are identical (not copied).", to.p_path, curr->fts_path); - badcp = rval = 1; + badcp = 1; if (S_ISDIR(curr->fts_statp->st_mode)) (void)fts_set(ftsp, curr, FTS_SKIP); continue; Seems to work, but I haven't tested it too much. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message