Skip to content

Conversation

@AZero13
Copy link
Contributor

@AZero13 AZero13 commented Dec 9, 2025

This is so it matches the documentation of fcopyfile

This is so it matches the documentation of fcopyfile
@jmschonfeld
Copy link
Contributor

@swift-ci please test


#if canImport(Darwin)
if fcopyfile(srcFD, dstFD, nil, copyfile_flags_t(COPYFILE_METADATA | COPYFILE_NOFOLLOW | extraFlags)) != 0 {
if fcopyfile(srcFD, dstFD, nil, copyfile_flags_t(COPYFILE_METADATA | COPYFILE_NOFOLLOW | extraFlags)) < 0 {
Copy link
Contributor

@glessard glessard Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation is that fcopyfile returns "less than 0 on error, and 0 on success", so the test already matched the documentation. If we're going to be this nit-picky, we should also assert that the return value is not greater than zero.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants