From owner-freebsd-bugs Mon Sep 16 6:30: 4 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7FFAF37B400 for ; Mon, 16 Sep 2002 06:30:03 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 41D2543E42 for ; Mon, 16 Sep 2002 06:30:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g8GDU2JU019789 for ; Mon, 16 Sep 2002 06:30:02 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g8GDU2aj019788; Mon, 16 Sep 2002 06:30:02 -0700 (PDT) Date: Mon, 16 Sep 2002 06:30:02 -0700 (PDT) Message-Id: <200209161330.g8GDU2aj019788@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Ralf Becker Subject: bin/42789: cp -p may report wrong exit status Reply-To: Ralf Becker 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 The following reply was made to PR bin/42789; it has been noted by GNATS. From: Ralf Becker To: freebsd-gnats-submit@FreeBSD.org, slaven.rezic@berlin.de Cc: Subject: bin/42789: cp -p may report wrong exit status Date: Mon, 16 Sep 2002 15:27:25 +0200 In my opinion slaven's fixed the problem at the wrong place. The error is caused by the fact that there is no check of the return value after calling one one of the copy_* functions. Isn't it enough to do this at the end of the loop ? *** cp.c.orig Mon Sep 16 13:19:16 2002 --- cp.c Mon Sep 16 13:26:26 2002 *************** *** 445,450 **** --- 445,454 ---- } if (vflag && !badcp) (void)printf("%s -> %s\n", curr->fts_path, to.p_path); + if ( rval != 0 || badcp != 0) { + /* error occured */ + break; + } } if (errno) err(1, "fts_read"); Ralf -- Ralf Becker ralf@akk.org Arbeitskreis Kultur und Kommunikation / Universitaet Karlsruhe Paulckeplatz 1 76131 Karlsruhe Tel 0721/96403-22 Fax 0721/608-4019 -------------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message