Commit Graph

14 Commits

Author SHA1 Message Date
Michael Forney eb74f374f2 getconf: Add an explicit return at the end of main
ISO C does not require that main() have an explicit return value
(if the end of the main function is reached, it is as if it returned
0). However, when built as sbase-box, the main function is turned
into getconf_main, which does not have the same special treatment.
2020-03-01 16:40:01 -08:00
Michael Forney b524eb6f3d getconf: Ensure output was written successfully 2017-09-03 17:26:04 -07:00
Michael Forney c225d88d49 getconf: Report invalid variables as errors
Printing `undefined` to stdout means that the variable is valid but not
set. Instead, report an error in this case.

linux 4.13 appends the result of `getconf LFS_CFLAGS` to HOSTCFLAGS,
even if it prints `undefined`. This is arguably a bug in the Makefile,
but even so, getconf shouldn't report that unsupported variables are
valid.
2017-09-03 17:23:28 -07:00
Mattias Andrée d301322cf2 getconf: fail if any other flag than -v is used
Signed-off-by: Mattias Andrée <maandree@kth.se>
2017-01-31 10:27:59 -08:00
Evan Gates de28c8bfa7 use only one getconf header
this simplifies the getconf.sh script and handling parallel make
2016-10-05 18:48:10 +02:00
sin c0eafd4610 Fix getconf(1) usage 2015-12-15 08:45:39 +00:00
Roberto E. Vargas Caballero 136f012d23 Remove ifdef hell from getconf.c
Every system is going to have a different configuration
so the only solution is to put an ifdef guard for every
value.  To do this, we generate the header at compile time
with a shell script.
2015-12-15 08:45:39 +00:00
sin 2366164de7 No need for semicolon after ARGEND
This is also the style used in Plan 9.
2015-11-01 10:18:55 +00:00
sin 27f9163d2e getconf: Fix trailing whitespace 2015-11-01 09:36:41 +00:00
FRIGN b70d2857ab Use ifdef in getconf(1) instead of commenting out missing defines
Thanks k0ga for the suggestion!
2015-11-01 09:36:41 +00:00
sin 23fdd768f0 Prepend "usage: " in usage() 2015-10-04 17:00:47 +01:00
sin 3423752465 Lint is dead - remove unnecessary cast to (void) 2015-10-04 16:49:59 +01:00
sin 627119df9f Comment out some more entries in getconf.c to make it build on OpenBSD
Uncomment the entries if your system supports them.
2015-10-01 17:17:23 +01:00
FRIGN 05996b997c Add getconf(1)
The logic is simple, it's just a pain in the ass to fill the
data-structures.
Some lines had to be commented out, as glibc/musl apparently
have not fully implemented the mandatory variables for the
2013 corrigendum of POSIX 2008.

Also added a manpage and the necessary entries in README.

I also removed it from the TODO.
2015-10-01 17:17:23 +01:00