Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F150050227
D10022.id26301.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D10022.id26301.diff
View Options
Index: lib/libkvm/kvm.c
===================================================================
--- lib/libkvm/kvm.c
+++ lib/libkvm/kvm.c
@@ -69,6 +69,9 @@
char *
kvm_geterr(kvm_t *kd)
{
+
+ if (kd == NULL)
+ return (NULL);
return (kd->errbuf);
}
@@ -272,6 +275,10 @@
{
int error = 0;
+ if (kd == NULL) {
+ errno = EINVAL;
+ return (-1);
+ }
if (kd->vmst != NULL)
kd->arch->ka_freevtop(kd);
if (kd->pmfd >= 0)
Index: lib/libkvm/kvm_open.3
===================================================================
--- lib/libkvm/kvm_open.3
+++ lib/libkvm/kvm_open.3
@@ -32,7 +32,7 @@
.\" @(#)kvm_open.3 8.3 (Berkeley) 4/19/94
.\" $FreeBSD$
.\"
-.Dd November 27, 2015
+.Dd March 15, 2017
.Dt KVM_OPEN 3
.Os
.Sh NAME
@@ -227,9 +227,28 @@
write the error message into
.Fa errbuf .
.Pp
+.Rv -std kvm_close
+.Sh ERRORS
The
.Fn kvm_close
-function returns 0 on success and -1 on failure.
+function may fail and set
+.Va errno
+for any errors specified for the
+.Xr close 2
+calls.
+.Pp
+The
+.Fn kvm_close
+function may also fail and set
+.Va errno
+if:
+.Bl -tag -width Er
+.It Bq Er EINVAL
+The value passed via
+.Fa *kd
+was
+.Dv NULL .
+.El
.Sh SEE ALSO
.Xr open 2 ,
.Xr kvm 3 ,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Mar 30, 12:18 AM (14 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30563107
Default Alt Text
D10022.id26301.diff (1 KB)
Attached To
Mode
D10022: Handle kd == NULL gracefully with kvm_geterr(3)
Attached
Detach File
Event Timeline
Log In to Comment