Skip to contentSkip to conversation

libxc: Use privcmd device on Linux

PATCH In review Bastian Blank 1 participant 1 message Dec 15, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 libxc: Use privcmd device on Linux

libxc: Use privcmd device on Linux

tools/libxc/xc_linux_osdep.c +5 -1
diff -r fd8e02fbcbfa -r ecf68e8d92f7 tools/libxc/xc_linux_osdep.c
@@ -45,7 +45,11 @@
 static xc_osdep_handle linux_privcmd_open(xc_interface *xch)
 {
     int flags, saved_errno;
-    int fd = open("/proc/xen/privcmd", O_RDWR);
+    int fd;
+
+    fd = open("/dev/xen/privcmd", O_RDWR);
+    if ( fd == -1 && errno == ENOENT )
+        fd = open("/proc/xen/privcmd", O_RDWR);
 
     if ( fd == -1 )
     {
Signature · 2 lines
Murder is contrary to the laws of man and God.
		-- M-5 Computer, "The Ultimate Computer", stardate 4731.3