Skip to content
This repository was archived by the owner on Aug 8, 2024. It is now read-only.

Cherry-pick dotnet/corefx#37583.#375

Merged
akoeplinger merged 1 commit intomono:masterfrom
baulig:work-backport-37583
Dec 10, 2019
Merged

Cherry-pick dotnet/corefx#37583.#375
akoeplinger merged 1 commit intomono:masterfrom
baulig:work-backport-37583

Conversation

@baulig
Copy link

@baulig baulig commented Dec 5, 2019

Use clonefile for CopyFile, if available (dotnet#37583)

  • Rework SystemNative_CopyFile to use paths instead of file descriptors

Use clonefile for CopyFile, if available

  • Bail out in SystemNative_CopyFile if access fails. We don't want to proceed if the destination file is read-only.

  • Handle a race condition where clonefile can result in EEXIST error

  • Update comment about fcopyfile

  • Update PathInternal.TrimEndingDirectorySeparator to Path.TrimEndingDirectorySeparator

  • Add missing close(outFd) call

  • Remove unnecessary ! operator

  • Save errno around close(outFd) calls

  • access already sets EACCESS errno, just keep it

  • Remove fcopyfile support

  • Open destination file with O_CLOEXEC

  • Return correct error code for source == destination

  • Rearrange error handling a bit

  • Remove forgotten HAVE_FCOPYFILE

(cherry picked from commit 5f45a8d)

Use clonefile for CopyFile, if available (dotnet#37583)

* Rework SystemNative_CopyFile to use paths instead of file descriptors

Use clonefile for CopyFile, if available

* Bail out in SystemNative_CopyFile if access fails. We don't want to proceed if the destination file is read-only.

* Handle a race condition where clonefile can result in EEXIST error

* Update comment about fcopyfile

* Update PathInternal.TrimEndingDirectorySeparator to Path.TrimEndingDirectorySeparator

* Add missing close(outFd) call

* Remove unnecessary ! operator

* Save errno around close(outFd) calls

* access already sets EACCESS errno, just keep it

* Remove fcopyfile support

* Open destination file with O_CLOEXEC

* Return correct error code for source == destination

* Rearrange error handling a bit

* Remove forgotten HAVE_FCOPYFILE

(cherry picked from commit 5f45a8d)
@akoeplinger akoeplinger merged commit c388c71 into mono:master Dec 10, 2019
baulig pushed a commit to baulig/corefx that referenced this pull request Dec 13, 2019
This reverts commit c388c71.

This reverts commit f27f69a.
akoeplinger pushed a commit that referenced this pull request Dec 13, 2019
This reverts commit c388c71.

This reverts commit f27f69a.
baulig pushed a commit to baulig/corefx that referenced this pull request Dec 13, 2019
Revert "Revert "Cherry-pick dotnet#37583. (mono#375)" (mono#382)"

This reverts commit 796b89e.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants