Thomas E. Spanjaard wrote:
See attached patch.
And the next attached patch fixes the only consumer of confstr(3) in our tree (something the other BSDs don't appear to have done).
Cheers,
--
Thomas E. Spanjaard
[EMAIL PROTECTED]
Index: getconf.c
===================================================================
RCS file: /home/dcvs/src/usr.bin/getconf/getconf.c,v
retrieving revision 1.3
diff -u -r1.3 getconf.c
--- getconf.c 4 Nov 2003 20:25:45 -0000 1.3
+++ getconf.c 5 Dec 2006 22:21:43 -0000
@@ -141,8 +141,9 @@
char *buf;
size_t len;
+ errno = 0;
len = confstr(key, 0, 0);
- if (len == (size_t)-1)
+ if (len == 0 && errno != 0)
err(EX_OSERR, "confstr: %s", name);
if (len == 0) {
signature.asc
Description: OpenPGP digital signature
