GNU bug report logs - #13352
cp: ignore EEXIST errors from mkdir

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: coreutils; Reported by: Mike Frysinger <vapier@HIDDEN>; Keywords: patch; dated Fri, 4 Jan 2013 00:06:01 UTC; Maintainer for coreutils is bug-coreutils@HIDDEN.
Changed bug title to 'cp: ignore EEXIST errors from mkdir' from '[PATCH] cp: ignore EEXIST errors from mkdir' Request was from Assaf Gordon <assafgordon@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 4 Jan 2013 05:15:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 04 00:15:01 2013
Received: from localhost ([127.0.0.1]:42469 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TqzcT-0008CR-F2
	for submit <at> debbugs.gnu.org; Fri, 04 Jan 2013 00:15:01 -0500
Received: from eggs.gnu.org ([208.118.235.92]:48791)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <vapier@HIDDEN>) id 1TqzcR-0008CK-GA
	for submit <at> debbugs.gnu.org; Fri, 04 Jan 2013 00:15:00 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <vapier@HIDDEN>) id 1TqzcK-0007i1-TK
	for submit <at> debbugs.gnu.org; Fri, 04 Jan 2013 00:14:54 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-106.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 
	T_RP_MATCHES_RCVD,
	USER_IN_WHITELIST autolearn=unavailable version=3.3.2
Received: from lists.gnu.org ([208.118.235.17]:44550)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <vapier@HIDDEN>) id 1TqzcK-0007hl-QO
	for submit <at> debbugs.gnu.org; Fri, 04 Jan 2013 00:14:52 -0500
Received: from eggs.gnu.org ([208.118.235.92]:60139)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <vapier@HIDDEN>) id 1TqzcI-0003vE-Fq
	for bug-coreutils@HIDDEN; Fri, 04 Jan 2013 00:14:52 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <vapier@HIDDEN>) id 1TqzcH-0007ds-F8
	for bug-coreutils@HIDDEN; Fri, 04 Jan 2013 00:14:50 -0500
Received: from smtp.gentoo.org ([140.211.166.183]:38674)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <vapier@HIDDEN>) id 1TqzcH-0007dZ-8v
	for bug-coreutils@HIDDEN; Fri, 04 Jan 2013 00:14:49 -0500
Received: from vapier.localnet (localhost [127.0.0.1])
	by smtp.gentoo.org (Postfix) with ESMTP id 47AAC335E2B;
	Fri,  4 Jan 2013 05:14:48 +0000 (UTC)
From: Mike Frysinger <vapier@HIDDEN>
Organization: wh0rd.org
To: bug-coreutils@HIDDEN
Subject: Re: bug#13352: [PATCH] cp: ignore EEXIST errors from mkdir
Date: Fri, 4 Jan 2013 00:16:39 -0500
User-Agent: KMail/1.13.7 (Linux/3.7.1; KDE/4.6.5; x86_64; ; )
References: <1357257996-24917-1-git-send-email-vapier@HIDDEN>
	<50E61F7F.3060408@HIDDEN>
In-Reply-To: <50E61F7F.3060408@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="nextPart10613297.TSoIYlA0zM";
	protocol="application/pgp-signature"; micalg=pgp-sha1
Content-Transfer-Encoding: 7bit
Message-Id: <201301040016.40111.vapier@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 208.118.235.17
X-Spam-Score: -3.4 (---)
X-Debbugs-Envelope-To: submit
Cc: 13352 <at> debbugs.gnu.org, Paul Eggert <eggert@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -3.4 (---)

--nextPart10613297.TSoIYlA0zM
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: quoted-printable

On Thursday 03 January 2013 19:17:03 Paul Eggert wrote:
> Thanks for the bug report, but I'm not sure that's the right
> fix.  Wouldn't it be better to address the following FIXME in cp.c?
>=20
>    /* FIXME: Synch this function with the one in ../lib/mkdir-p.c.  */
>=20
> The function in mkdir-p.c doesn't have the bug.

i thought it might, but i didn't want to get into the nuances here.  `mkdir=
 -
p` isn't copying a tree and its set of perms like `cp -pR` does.  it might =
not=20
actually affect the code, but i'm not familiar enough with the code base to=
=20
say.
=2Dmike

--nextPart10613297.TSoIYlA0zM
Content-Type: application/pgp-signature; name=signature.asc 
Content-Description: This is a digitally signed message part.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)

iQIcBAABAgAGBQJQ5mW4AAoJEEFjO5/oN/WB8GkP/139LlJGqDozpHGGXx/pBDnQ
7Iz2S4dPJUJPyavVkgshrlnNUhCvyr2CthUdZbxpEcbtA3txfi1kSDXE/P4S20cm
5kRpwO/9ykw1QCg810r5BIkxsAqxO1UtvdSIQ516BkbQ0fYs0nMC+7ngLpe46Rjk
mv0Y9joOUw9MtbRIW944X4f+XE52hDJQIHJSzGc4Xzygu4fX7kvY8cHv7vkcIEsG
9pig7KhQOLbPPUUXa2lC6y5mZPz8i++1k73IUkupO8LO5gd65xiwC4fIfXZ3+/92
3mTiUqljPKEJsMFEZFMte4vywvaNHjBTKVlYcNcdyTP2oKsrBJYGBer1XoAP1Xvo
7gjCY7O+00HdGBLXU2r+q42H9iHrW3tR70V+VkfrqkHOoyAzVTB3BA5AYhOi7jgS
/yjNUX4up4qx3W1kDtuJXTzn+Hl8re8LT9YgMWYq7w+0ObppzEhtxUlJmqQBD+vr
/6EIY3VmWGg3KCxFxQQUvR7fPZvLxdKhZua3FuLR4Z3sep3vwl2gkKraSh3Exz1r
4brIYcUk33wiM05jCtWvOt99rt98tuADHRA3F5pAxCzcI9FQktGmdMcYQ7thh0wi
gac8YDMZDyfd3pnzJG5ptIYZYyVkEeLrLsi6LQgsNyqiBtFiN+cvb6874IVcPRv+
eypqYRmODL9ecAHDBrKF
=cYFw
-----END PGP SIGNATURE-----

--nextPart10613297.TSoIYlA0zM--




Information forwarded to bug-coreutils@HIDDEN:
bug#13352; Package coreutils. Full text available.

Message received at 13352 <at> debbugs.gnu.org:


Received: (at 13352) by debbugs.gnu.org; 4 Jan 2013 05:14:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 04 00:14:56 2013
Received: from localhost ([127.0.0.1]:42466 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TqzcO-0008C8-7y
	for submit <at> debbugs.gnu.org; Fri, 04 Jan 2013 00:14:56 -0500
Received: from smtp.gentoo.org ([140.211.166.183]:45569)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <vapier@HIDDEN>) id 1TqzcM-0008C1-Bg
	for 13352 <at> debbugs.gnu.org; Fri, 04 Jan 2013 00:14:55 -0500
Received: from vapier.localnet (localhost [127.0.0.1])
	by smtp.gentoo.org (Postfix) with ESMTP id 47AAC335E2B;
	Fri,  4 Jan 2013 05:14:48 +0000 (UTC)
From: Mike Frysinger <vapier@HIDDEN>
Organization: wh0rd.org
To: bug-coreutils@HIDDEN
Subject: Re: bug#13352: [PATCH] cp: ignore EEXIST errors from mkdir
Date: Fri, 4 Jan 2013 00:16:39 -0500
User-Agent: KMail/1.13.7 (Linux/3.7.1; KDE/4.6.5; x86_64; ; )
References: <1357257996-24917-1-git-send-email-vapier@HIDDEN>
	<50E61F7F.3060408@HIDDEN>
In-Reply-To: <50E61F7F.3060408@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="nextPart10613297.TSoIYlA0zM";
	protocol="application/pgp-signature"; micalg=pgp-sha1
Content-Transfer-Encoding: 7bit
Message-Id: <201301040016.40111.vapier@HIDDEN>
X-Spam-Score: -4.2 (----)
X-Debbugs-Envelope-To: 13352
Cc: 13352 <at> debbugs.gnu.org, Paul Eggert <eggert@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -4.2 (----)

--nextPart10613297.TSoIYlA0zM
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: quoted-printable

On Thursday 03 January 2013 19:17:03 Paul Eggert wrote:
> Thanks for the bug report, but I'm not sure that's the right
> fix.  Wouldn't it be better to address the following FIXME in cp.c?
>=20
>    /* FIXME: Synch this function with the one in ../lib/mkdir-p.c.  */
>=20
> The function in mkdir-p.c doesn't have the bug.

i thought it might, but i didn't want to get into the nuances here.  `mkdir=
 -
p` isn't copying a tree and its set of perms like `cp -pR` does.  it might =
not=20
actually affect the code, but i'm not familiar enough with the code base to=
=20
say.
=2Dmike

--nextPart10613297.TSoIYlA0zM
Content-Type: application/pgp-signature; name=signature.asc 
Content-Description: This is a digitally signed message part.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)

iQIcBAABAgAGBQJQ5mW4AAoJEEFjO5/oN/WB8GkP/139LlJGqDozpHGGXx/pBDnQ
7Iz2S4dPJUJPyavVkgshrlnNUhCvyr2CthUdZbxpEcbtA3txfi1kSDXE/P4S20cm
5kRpwO/9ykw1QCg810r5BIkxsAqxO1UtvdSIQ516BkbQ0fYs0nMC+7ngLpe46Rjk
mv0Y9joOUw9MtbRIW944X4f+XE52hDJQIHJSzGc4Xzygu4fX7kvY8cHv7vkcIEsG
9pig7KhQOLbPPUUXa2lC6y5mZPz8i++1k73IUkupO8LO5gd65xiwC4fIfXZ3+/92
3mTiUqljPKEJsMFEZFMte4vywvaNHjBTKVlYcNcdyTP2oKsrBJYGBer1XoAP1Xvo
7gjCY7O+00HdGBLXU2r+q42H9iHrW3tR70V+VkfrqkHOoyAzVTB3BA5AYhOi7jgS
/yjNUX4up4qx3W1kDtuJXTzn+Hl8re8LT9YgMWYq7w+0ObppzEhtxUlJmqQBD+vr
/6EIY3VmWGg3KCxFxQQUvR7fPZvLxdKhZua3FuLR4Z3sep3vwl2gkKraSh3Exz1r
4brIYcUk33wiM05jCtWvOt99rt98tuADHRA3F5pAxCzcI9FQktGmdMcYQ7thh0wi
gac8YDMZDyfd3pnzJG5ptIYZYyVkEeLrLsi6LQgsNyqiBtFiN+cvb6874IVcPRv+
eypqYRmODL9ecAHDBrKF
=cYFw
-----END PGP SIGNATURE-----

--nextPart10613297.TSoIYlA0zM--




Information forwarded to bug-coreutils@HIDDEN:
bug#13352; Package coreutils. Full text available.

Message received at 13352 <at> debbugs.gnu.org:


Received: (at 13352) by debbugs.gnu.org; 4 Jan 2013 00:17:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jan 03 19:17:14 2013
Received: from localhost ([127.0.0.1]:42221 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TquyH-0006YE-MA
	for submit <at> debbugs.gnu.org; Thu, 03 Jan 2013 19:17:14 -0500
Received: from smtp.cs.ucla.edu ([131.179.128.62]:33633)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <eggert@HIDDEN>) id 1TquyD-0006Y3-1i
	for 13352 <at> debbugs.gnu.org; Thu, 03 Jan 2013 19:17:11 -0500
Received: from localhost (localhost.localdomain [127.0.0.1])
	by smtp.cs.ucla.edu (Postfix) with ESMTP id 49D91A60005;
	Thu,  3 Jan 2013 16:17:04 -0800 (PST)
X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu
Received: from smtp.cs.ucla.edu ([127.0.0.1])
	by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id QLtI-yHPN1Lb; Thu,  3 Jan 2013 16:17:03 -0800 (PST)
Received: from [192.168.1.9] (pool-71-189-154-249.lsanca.fios.verizon.net
	[71.189.154.249])
	by smtp.cs.ucla.edu (Postfix) with ESMTPSA id B189439E8008;
	Thu,  3 Jan 2013 16:17:03 -0800 (PST)
Message-ID: <50E61F7F.3060408@HIDDEN>
Date: Thu, 03 Jan 2013 16:17:03 -0800
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Mike Frysinger <vapier@HIDDEN>
Subject: Re: bug#13352: [PATCH] cp: ignore EEXIST errors from mkdir
References: <1357257996-24917-1-git-send-email-vapier@HIDDEN>
In-Reply-To: <1357257996-24917-1-git-send-email-vapier@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -1.5 (-)
X-Debbugs-Envelope-To: 13352
Cc: 13352 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.5 (-)

Thanks for the bug report, but I'm not sure that's the right
fix.  Wouldn't it be better to address the following FIXME in cp.c?

   /* FIXME: Synch this function with the one in ../lib/mkdir-p.c.  */

The function in mkdir-p.c doesn't have the bug.




Information forwarded to bug-coreutils@HIDDEN:
bug#13352; Package coreutils. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 4 Jan 2013 00:05:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jan 03 19:05:03 2013
Received: from localhost ([127.0.0.1]:42199 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TqumT-0006D2-Uk
	for submit <at> debbugs.gnu.org; Thu, 03 Jan 2013 19:05:02 -0500
Received: from eggs.gnu.org ([208.118.235.92]:58784)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <vapier@HIDDEN>) id 1TqumR-0006Cq-79
	for submit <at> debbugs.gnu.org; Thu, 03 Jan 2013 19:05:00 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <vapier@HIDDEN>) id 1TqumJ-0003G3-M9
	for submit <at> debbugs.gnu.org; Thu, 03 Jan 2013 19:04:55 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-106.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 
	T_RP_MATCHES_RCVD,
	USER_IN_WHITELIST autolearn=unavailable version=3.3.2
Received: from lists.gnu.org ([208.118.235.17]:35998)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <vapier@HIDDEN>) id 1TqumJ-0003Fz-IW
	for submit <at> debbugs.gnu.org; Thu, 03 Jan 2013 19:04:51 -0500
Received: from eggs.gnu.org ([208.118.235.92]:41863)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <vapier@HIDDEN>) id 1TqumH-0000gj-3j
	for bug-coreutils@HIDDEN; Thu, 03 Jan 2013 19:04:51 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <vapier@HIDDEN>) id 1TqumG-0003Ep-00
	for bug-coreutils@HIDDEN; Thu, 03 Jan 2013 19:04:49 -0500
Received: from smtp.gentoo.org ([140.211.166.183]:55251)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <vapier@HIDDEN>) id 1TqumF-0003EY-Pj
	for bug-coreutils@HIDDEN; Thu, 03 Jan 2013 19:04:47 -0500
Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.gentoo.org (Postfix) with ESMTP id A556C33D860
	for <bug-coreutils@HIDDEN>; Fri,  4 Jan 2013 00:04:46 +0000 (UTC)
From: Mike Frysinger <vapier@HIDDEN>
To: bug-coreutils@HIDDEN
Subject: [PATCH] cp: ignore EEXIST errors from mkdir
Date: Thu,  3 Jan 2013 19:06:36 -0500
Message-Id: <1357257996-24917-1-git-send-email-vapier@HIDDEN>
X-Mailer: git-send-email 1.8.0.2
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 208.118.235.17
X-Spam-Score: -3.4 (---)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -4.2 (----)

If you're copying multiple source trees into a single destination in
parallel (which have overlapping dirs, but not files), you can easily
hit a race condition.

This can crop up more generally if you're running multiple installs
from different build directories in parallel.  You don't get as much
of a speed up due to the parallel I/O, but you do from processing all
the build scripts.

Simple test to reproduce:
	mkdir -p in/`printf %s/ {a..z} {0..10}`
	(rm -rf out; for ((i=0;i<100;++i)); do cp -pPR in out & :; done)

* src/cp.c (make_dir_parents_private): Ignore EEXIST from mkdir.
---
 src/cp.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/cp.c b/src/cp.c
index 625ea0b..b9dff18 100644
--- a/src/cp.c
+++ b/src/cp.c
@@ -473,9 +473,15 @@ make_dir_parents_private (char const *const_dir, size_t src_offset,
               mkdir_mode = src_mode & CHMOD_MODE_BITS & ~omitted_permissions;
               if (mkdir (dir, mkdir_mode) != 0)
                 {
-                  error (0, errno, _("cannot make directory %s"),
-                         quote (dir));
-                  return false;
+                  /* If someone else created it between our stat/mkdir,
+                     don't complain.  It's debatable whether we should
+                     also preserve the mode bits in this scenario.  */
+                  if (errno != EEXIST)
+                    {
+                      error (0, errno, _("cannot make directory %s"),
+                             quote (dir));
+                      return false;
+                    }
                 }
               else
                 {
-- 
1.8.0.2





Acknowledgement sent to Mike Frysinger <vapier@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-coreutils@HIDDEN. Full text available.
Report forwarded to bug-coreutils@HIDDEN:
bug#13352; Package coreutils. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.