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.
This commit is contained in:
Michael Forney
2017-09-03 15:39:47 -07:00
parent ed78aef5b1
commit c225d88d49
2 changed files with 3 additions and 5 deletions

View File

@@ -102,7 +102,5 @@ main(int argc, char *argv[])
usage();
}
puts("undefined");
return 1;
eprintf("invalid variable: %s\n", argv[0]);
}