[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 3/4] gdbsx: prefer privcmd character device



Prefer using the character device over the proc file if the character
device exists.

CC: Mukesh Rathor <mukesh.rathor@xxxxxxxxxx>
CC: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
CC: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
CC: Ian Campbell <ian.campbell@xxxxxxxxxx>
CC: Wei Liu <wei.liu2@xxxxxxxxxx>
Signed-off-by: Doug Goldstein <cardoe@xxxxxxxxxx>
---
 tools/debugger/gdbsx/xg/xg_main.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tools/debugger/gdbsx/xg/xg_main.c 
b/tools/debugger/gdbsx/xg/xg_main.c
index 8c8a402..9364aee 100644
--- a/tools/debugger/gdbsx/xg/xg_main.c
+++ b/tools/debugger/gdbsx/xg/xg_main.c
@@ -127,9 +127,11 @@ xg_init()
     int flags, saved_errno;
 
     XGTRC("E\n");
-    if ((_dom0_fd=open("/proc/xen/privcmd", O_RDWR)) == -1) {
-        perror("Failed to open /proc/xen/privcmd\n");
-        return -1;
+    if ((_dom0_fd=open("/dev/xen/privcmd", O_RDWR)) == -1) {
+        if ((_dom0_fd=open("/proc/xen/privcmd", O_RDWR)) == -1) {
+            perror("Failed to open /dev/xen/privcmd or /proc/xen/privcmd\n");
+            return -1;
+        }
     }
     /* Although we return the file handle as the 'xc handle' the API
      * does not specify / guarentee that this integer is in fact
-- 
2.4.10


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.