Fix the error buffer passed to kvm_openfiles to have a length of
_POSIX2_LINE_MAX as required. While being there, wrap an overly long line. MFC after: 3 days
This commit is contained in:
parent
f2e34a452a
commit
5a3c3d039a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=77205
@ -50,6 +50,7 @@ static const char rcsid[] =
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
#include <err.h>
|
||||
#include <limits.h>
|
||||
#include <locale.h>
|
||||
#include <nlist.h>
|
||||
#include <paths.h>
|
||||
@ -84,7 +85,7 @@ main(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
char errbuf[80], dummy;
|
||||
char errbuf[_POSIX2_LINE_MAX], dummy;
|
||||
size_t size;
|
||||
int err;
|
||||
|
||||
@ -127,7 +128,8 @@ main(argc, argv)
|
||||
* devices. We can now use sysctl only.
|
||||
*/
|
||||
use_kvm = 0;
|
||||
kd = kvm_openfiles("/dev/null", "/dev/null", "/dev/null", O_RDONLY, errbuf);
|
||||
kd = kvm_openfiles("/dev/null", "/dev/null", "/dev/null",
|
||||
O_RDONLY, errbuf);
|
||||
if (kd == NULL) {
|
||||
error("%s", errbuf);
|
||||
exit(1);
|
||||
|
Loading…
Reference in New Issue
Block a user