Page MenuHomeFreeBSD

tests: unix: allow passfd's recvfd_payload() to fail
AbandonedPublic

Authored by kevans on Thu, Jun 4, 5:05 AM.
Tags
None
Referenced Files
F159368581: D57425.id.diff
Sat, Jun 13, 9:16 AM
F159314702: D57425.id179177.diff
Fri, Jun 12, 7:00 PM
Unknown Object (File)
Tue, Jun 9, 8:49 PM
Unknown Object (File)
Tue, Jun 9, 8:23 PM
Unknown Object (File)
Tue, Jun 9, 11:26 AM
Unknown Object (File)
Mon, Jun 8, 3:45 PM
Unknown Object (File)
Sun, Jun 7, 12:12 PM
Unknown Object (File)
Fri, Jun 5, 4:56 PM
Subscribers

Details

Reviewers
markj
kib
glebius
Summary

We're going to add some tests that exercise failure at one or both of
these points, so add an argument to allow it and return the len -- for
the control message failure, the caller will be verifying that we
received data but no files.

No functional change.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 73652
Build 70535: arc lint + arc unit

Event Timeline

kevans requested review of this revision.Thu, Jun 4, 5:05 AM
This revision is now accepted and ready to land.Mon, Jun 8, 5:52 PM

I know I'm being annoying, but I really don't like naked bool function parameters. They're expedient but they make function calls harder to read and add complexity to the function itself. It would be cleaner to refactor recvfd_payload(): add a helper function which sets up the msghdr and calls recvmsg(), letting the caller provide a cmsg buffer and letting it decide what to do with the return value. Use that helper directly in your new test case.

Anyway, I don't object to this, I just try to avoid this pattern myself.

I know I'm being annoying, but I really don't like naked bool function parameters.

Nah, that's completely fair criticism. Doing so also allows me to better confirrm that the cmsg was empty.