Page MenuHomeFreeBSD

Cleanup of setfacl.c
ClosedPublic

Authored by mhorne063_gmail.com on Apr 13 2018, 6:35 PM.
Tags
None
Referenced Files
F148751403: D15060.id41922.diff
Fri, Mar 20, 1:01 AM
Unknown Object (File)
Thu, Mar 19, 4:01 AM
Unknown Object (File)
Thu, Mar 19, 2:21 AM
Unknown Object (File)
Thu, Mar 19, 2:20 AM
Unknown Object (File)
Mon, Mar 16, 1:09 AM
Unknown Object (File)
Thu, Mar 5, 11:38 PM
Unknown Object (File)
Tue, Mar 3, 2:00 PM
Unknown Object (File)
Feb 14 2026, 6:39 AM
Subscribers

Details

Summary

Some cleanup changes to setfacl.c as briefly mentioned in D14934.

  • Break the main() function into a couple more manageable sized pieces.
  • Some small tweaks to follow style(9)

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bin/setfacl/setfacl.c
70–73 ↗(On Diff #41442)

It's not necessary to explicitly initialize these to false

bin/setfacl/setfacl.c
67 ↗(On Diff #41442)

might as well make this a bool while here

74 ↗(On Diff #41442)

also no need for whitespace between the global variables

77–79 ↗(On Diff #41442)

generally these should be in alpha order

92 ↗(On Diff #41442)

perhaps just stdin_files()

395–396 ↗(On Diff #41442)

This is a tricky case; I'd prefer not to break a string in the middle (so that e.g. grep "cannot be less than zero" works to find the source of a message).

It looks a bit awkward but

errx(1,
    "%s: ...",
    optarg);

is probably best

Address review comments

Converted some existing global variables to bool

Made need_mask global variable static

Fixed prototype whitespace in setfacl.h

This revision is now accepted and ready to land.Apr 27 2018, 3:16 PM
This revision was automatically updated to reflect the committed changes.