]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r315686,r315688:
authorngie <ngie@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 28 Mar 2017 06:05:26 +0000 (06:05 +0000)
committerngie <ngie@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 28 Mar 2017 06:05:26 +0000 (06:05 +0000)
commit32b7cb72e0739211728e29f2cb7fa339cbef5470
tree396d36f084ac882eb6cb2f99cf3c9c8ec3bed8f5
parent7633582e661d119326866996ac310656d90c1c21
MFC r315686,r315688:

r315686:

kvm_geterr: handle `kd` == NULL in a deterministic/graceful manner

Return a NUL string instead of just working by accident with kvm_geterr(3)
when MALLOC_PRODUCTION is disabled (I didn't confirm the MALLOC_PRODUCTION
being enabled path).

Document the new explicit return behavior for kvm_geterr(3), as well
as the previous implicit behavior, i.e., the buffer attached to
returned via kvm_geterr(3) would be empty if a previous error hadn't been
stored in `kd`.

r315688:

kvm_write: fix -Wcast-qual warning in pointer arithmetic argument

Cast buf to `const char *` when doing arithmetic operation to match
`cp`'s type [1].

git-svn-id: svn://svn.freebsd.org/base/stable/10@316072 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
lib/libkvm/kvm.c
lib/libkvm/kvm_geterr.3