mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-22 02:37:15 +00:00
sysctl: emit a newline after NULL node descriptions
Previously when printing the sysctl description (via the -d flag) we omitted the newline if the node provided no description (i.e., NULL). This could be observed via e.g. `sysctl -d dev`. PR: 44034 Reviewed by: zlei Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D42112
This commit is contained in:
parent
892654fe9b
commit
75be7e3027
|
@ -998,8 +998,10 @@ show_info(char *name, const char *sep, int ctltype, char *fmt, int *qoid, int nl
|
|||
bzero(buf, BUFSIZ);
|
||||
j = sizeof(buf);
|
||||
i = sysctl(qoid, nlen + 2, buf, &j, 0, 0);
|
||||
if (i < 0)
|
||||
if (i < 0) {
|
||||
putchar('\n');
|
||||
return (1);
|
||||
}
|
||||
fputs(buf, stdout);
|
||||
return (error);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue