From 11947dbc7d661668935fadba4b8535c0aaf46172 Mon Sep 17 00:00:00 2001 From: wollman Date: Wed, 21 Feb 2001 19:31:53 +0000 Subject: [PATCH] Destroy the evidence of my misunderstanding of the specification. Also fix up the phrasing in the man page a bit. --- usr.bin/getconf/getconf.1 | 19 ++----------------- usr.bin/getconf/getconf.c | 12 ------------ 2 files changed, 2 insertions(+), 29 deletions(-) diff --git a/usr.bin/getconf/getconf.1 b/usr.bin/getconf/getconf.1 index 1e3d2e5ebf45..e370d4094a2c 100644 --- a/usr.bin/getconf/getconf.1 +++ b/usr.bin/getconf/getconf.1 @@ -46,11 +46,11 @@ .Sh DESCRIPTION The .Nm -utility outputs the value of +utility prints the value of a .Tn POSIX or .Tn X/Open -system or path configuration variable on the standard output. +system or path configuration variable to the standard output. If the specified variable is undefined, the string .Dq Li undefined is output. @@ -142,20 +142,5 @@ The .Nm command first appeared in .Fx 5.0 . -.Sh BUGS -The original -.Tn X/Open -specification erroneously requires the return values of -.Xr pathconf 2 -and -.Xr sysconf 3 -to be printed using the -.Xr printf 3 -format specifier -.Li \&"%d" . -We ignore that aspect of the specification and use the -correct -.Li \&"%ld" -format. .Sh AUTHORS .An Garrett A. Wollman Aq wollman@lcs.mit.edu diff --git a/usr.bin/getconf/getconf.c b/usr.bin/getconf/getconf.c index b33f5740d2a5..87b91b1a283a 100644 --- a/usr.bin/getconf/getconf.c +++ b/usr.bin/getconf/getconf.c @@ -136,12 +136,6 @@ do_sysconf(const char *name, int key) else if (value == -1) printf("undefined\n"); else - /* - * SUSv2 specifies that the value, if defined, is to be - * printed using the format "%d\n". This is clearly - * erroneous, since sysconf is defined to return a long - * and not an int. - */ printf("%ld\n", value); } @@ -157,11 +151,5 @@ do_pathconf(const char *name, int key, const char *path) else if (value == -1) printf("undefined\n"); else - /* - * SUSv2 specifies that the value, if defined, is to be - * printed using the format "%d\n". This is clearly - * erroneous, since sysconf is defined to return a long - * and not an int. - */ printf("%ld\n", value); }