Page MenuHomeFreeBSD

Introduce flopenat(3) function.
ClosedPublic

Authored by oshogbo on Jul 21 2017, 6:14 PM.
Tags
None
Referenced Files
F135292335: D11690.id31066.diff
Sat, Nov 8, 9:59 AM
Unknown Object (File)
Fri, Nov 7, 10:44 AM
Unknown Object (File)
Thu, Nov 6, 2:31 PM
Unknown Object (File)
Wed, Nov 5, 10:57 PM
Unknown Object (File)
Wed, Oct 29, 2:03 AM
Unknown Object (File)
Mon, Oct 27, 3:33 PM
Unknown Object (File)
Mon, Oct 27, 3:33 PM
Unknown Object (File)
Mon, Oct 27, 3:33 PM
Subscribers
None

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

oshogbo retitled this revision from Introcude flopenat(3) function. to Introduce flopenat(3) function..

Sorry guys for spam ;/
Regenerate with -U99999

lib/libutil/flopen.3
32–33

only one name per line

lib/libutil/flopen.c
55–57

these three lines can remain here, they have no bearing on the varargs code

lib/libutil/libutil.h
96

please follow the leading-underscore convention for argument names

oshogbo marked 2 inline comments as done.

Update after des@ review.

Should the man page document AT_FDCWD?

This LGTM, with @des's approval.

I guess you could copy the sentence about AT_FDCWD from openat(2).

BTW, it just occurred to me that you can avoid the duplicate O_CREAT logic by simply passing ap to flopenatm(), which you can then rename vflopenat() (v for va_list, like vfprintf(), instead of m for mode).

Should the man page document AT_FDCWD?

This LGTM, with @des's approval.

Done.

In D11690#243927, @des wrote:

I guess you could copy the sentence about AT_FDCWD from openat(2).

Done.

In D11690#243927, @des wrote:

BTW, it just occurred to me that you can avoid the duplicate O_CREAT logic by simply passing ap to flopenatm(), which you can then rename vflopenat() (v for va_list, like vfprintf(), instead of m for mode).

Duh ofc... Thanks!!!

Just a few nits before I approve this :)

lib/libutil/flopen.c
120–121

per style(9), ap goes first.

126

per style(9), no blank line here.

133–134

per style(9), ap goes first.

139

per style(9), no blank line here.

oshogbo marked 4 inline comments as done.

Style fixes.

This revision is now accepted and ready to land.Aug 3 2017, 11:12 AM
This revision was automatically updated to reflect the committed changes.