Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145617482
D10065.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
D10065.diff
View Options
Index: head/lib/libkvm/kvm.c
===================================================================
--- head/lib/libkvm/kvm.c
+++ head/lib/libkvm/kvm.c
@@ -272,6 +272,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: head/lib/libkvm/kvm_open.3
===================================================================
--- head/lib/libkvm/kvm_open.3
+++ head/lib/libkvm/kvm_open.3
@@ -32,7 +32,7 @@
.\" @(#)kvm_open.3 8.3 (Berkeley) 4/19/94
.\" $FreeBSD$
.\"
-.Dd March 19, 2017
+.Dd March 20, 2017
.Dt KVM_OPEN 3
.Os
.Sh NAME
@@ -227,10 +227,29 @@
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 the global variable
+.Va errno
+for any of the errors specified for
+.Xr close 2 .
+.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 close 2 ,
.Xr open 2 ,
.Xr kvm 3 ,
.Xr kvm_getargv 3 ,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Feb 23, 6:00 AM (11 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28951816
Default Alt Text
D10065.diff (1 KB)
Attached To
Mode
D10065: Handle kd == NULL gracefully with kvm_close(3)
Attached
Detach File
Event Timeline
Log In to Comment