summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: acad0c6)
raw | patch | inline | side by side (parent: acad0c6)
author | ale@biancalanas.net <ale@biancalanas.net> | |
Fri, 1 May 2015 16:48:30 +0000 (16:48 +0000) | ||
committer | Marc Fournier <marc.fournier@camptocamp.com> | |
Tue, 5 May 2015 15:41:41 +0000 (17:41 +0200) |
src/swap.c | patch | blob | history |
diff --git a/src/swap.c b/src/swap.c
index 1621f7af677a2a83ee866ee752cece72fcea3c60..b3aa4f7dbc4bb3c7b5e8cacc7432b755215c0549 100644 (file)
--- a/src/swap.c
+++ b/src/swap.c
/* #endif defined(VM_SWAPUSAGE) */
#elif HAVE_LIBKVM_GETSWAPINFO
+ char errbuf[1024];
+
if (kvm_obj != NULL)
{
kvm_close (kvm_obj);
kvm_pagesize = getpagesize ();
- if ((kvm_obj = kvm_open (NULL, /* execfile */
- NULL, /* corefile */
- NULL, /* swapfile */
- O_RDONLY, /* flags */
- NULL)) /* errstr */
- == NULL)
+ kvm_obj = kvm_openfiles (NULL, "/dev/null", NULL, O_RDONLY, errbuf);
+
+ if (kvm_obj == NULL)
{
- ERROR ("swap plugin: kvm_open failed.");
+ ERROR ("swap plugin: kvm_open failed, %s", errbuf);
return (-1);
}
/* #endif HAVE_LIBKVM_GETSWAPINFO */