Page MenuHomeFreeBSD

Add an -a flag to getconf.
ClosedPublic

Authored by jhb on Sep 14 2017, 5:38 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Aug 12, 1:16 PM
Unknown Object (File)
Wed, Aug 12, 12:59 PM
Unknown Object (File)
Mon, Aug 10, 11:32 PM
Unknown Object (File)
Tue, Aug 4, 7:51 AM
Unknown Object (File)
Tue, Aug 4, 5:15 AM
Unknown Object (File)
Mon, Aug 3, 6:28 AM
Unknown Object (File)
Sat, Aug 1, 6:56 AM
Unknown Object (File)
Mon, Jul 27, 8:20 AM
Subscribers
None

Details

Summary

When -a is specified, the name and value of all system or path configuration
values is reported to standard output.

Linux's getconf supports -a, but only for system variables according to the
manual page.

Diff Detail

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

Event Timeline

kib added inline comments.
usr.bin/getconf/getconf.c
213 ↗(On Diff #33082)

Why err() there, while other do_oneXXX() only warn() about error ? Is this for situations like ENOENT where the path is nonexistent ? I am not sure that other situations are impossible in principle where some parameter gives !EINVAL error.

IMO user deserves the fallout there.

usr.bin/getconf/pathconf.gperf
78 ↗(On Diff #33082)

I would prefer to have the multi-line loop body braced.

This revision is now accepted and ready to land.Sep 14 2017, 8:08 PM
usr.bin/getconf/getconf.c
213 ↗(On Diff #33082)

Yes, the idea was to die once for ENOENT, but it is perhaps a bit fragile, so warn() is ok.

  • Use warn() for errors from pathconf().
  • Add braces in foreach routines.
This revision now requires review to proceed.Sep 15 2017, 10:51 PM
This revision was automatically updated to reflect the committed changes.