Page MenuHomeFreeBSD

Cleanup of setfacl.c
ClosedPublic

Authored by mhorne063_gmail.com on Apr 13 2018, 6:35 PM.
Tags
None
Referenced Files
F142246006: D15060.id41917.diff
Sat, Jan 17, 6:30 PM
Unknown Object (File)
Sat, Jan 17, 9:03 AM
Unknown Object (File)
Fri, Jan 16, 11:14 PM
Unknown Object (File)
Fri, Jan 16, 5:50 AM
Unknown Object (File)
Tue, Jan 13, 7:16 AM
Unknown Object (File)
Sat, Jan 10, 4:11 PM
Unknown Object (File)
Thu, Jan 1, 4:15 PM
Unknown Object (File)
Dec 16 2025, 3:01 PM
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

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

bin/setfacl/setfacl.c
66–69

It's not necessary to explicitly initialize these to false

bin/setfacl/setfacl.c
64–65

might as well make this a bool while here

70

also no need for whitespace between the global variables

77–78

generally these should be in alpha order

90

perhaps just stdin_files()

394–397

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.