Page MenuHomeFreeBSD

tee: try opening as a UNIX socket if open(2) fails
AcceptedPublic

Authored by kevans on Tue, Dec 24, 10:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jan 3, 2:59 AM
Unknown Object (File)
Tue, Dec 31, 5:20 PM
Unknown Object (File)
Thu, Dec 26, 8:04 AM
Unknown Object (File)
Thu, Dec 26, 5:50 AM
Unknown Object (File)
Thu, Dec 26, 1:39 AM
Unknown Object (File)
Wed, Dec 25, 4:37 AM
Subscribers

Details

Reviewers
des
emaste
markj
Summary

If we get EOPNOTSUPP from open() failing, then it may just be that we're
looking at a unix(4) socket instead of a normal file/device or whatnot.
Fallback to trying to open it as a unix(4) socket, which is a useful
feature that doesn't add much complexity.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 61326
Build 58210: arc lint + arc unit

Event Timeline

I'd like to look at incorporating something like https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=117733, too, though the patch isn't available anymore.

Should we mention this in the man page? Not sure it's necessary, but if this is something that other tee implementations don't do, or something that they document, we ought to.

Add a note to the manpage that we'll also accept UNIX sockets. No other
implementation that I looked at seems to do this, but it would be handy.

This revision is now accepted and ready to land.Thu, Dec 26, 1:36 PM
markj added inline comments.
usr.bin/tee/tests/tee_test.sh
85

Since the value of $unixsock is hard-coded here, maybe just get rid of the variable entirely?

usr.bin/tee/tests/tee_test.sh
70

No blank line before variables